Would this work for AutoVIP?

DiverseLulz

Learning C# :D
Sep 26, 2011
90
9
I found this on os & as the title says Would this work? I have the buy button above it But that doesn't need to be included
Code:
<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'buy');
if(isset($_GET['u']))
{
$username = $core->EscapeString($_GET['u']);
}
else
{
$username = $core->EscapeString($_SESSION['username']);
}
 
 
function write2LogFile( $message, $file = "mylog.txt" ) { $file = fopen($file, "a"); fputs($file, "[".date('d-m-Y')."] ".$message."\n"); fclose($file); }
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value)
{
        $value = urlencode(stripslashes($value));
        $req .= "&$key=$value";
}
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
if (!$fp) {
        write2LogFile( "ERROR Can not connect to paypal!" );
}
else
{
        fputs ($fp, $header . $req);
        while (!feof($fp))
        {
                $res = fgets ($fp, 1024);
                if (strcmp ($res, "VERIFIED") == 0)
                {
                        $payment_status = $_POST['payment_status'];
                        $transaction_id = $_POST['txn_id'];
                        $payer_email    = $_POST['payer_email'];
                        $custom_field   = $_POST['custom'];
 
                        if ( $payment_status == 'Completed' )
                        {                      
                                // Make the user VIP
mysql_query("UPDATE users SET rank = '2' WHERE username='$username'");
                        }
 
{                      
                                // Make the user VIP
mysql_query("UPDATE users SET vip = '1' WHERE username='$username'");
                        }
 
                        else if ( $payment_status == 'Canceled_Reversal' )
                        {
                                // Ban the account
mysql_query("INSERT INTO bans (bantype, value, reason, expire, added_by, appeal_state)
VALUES ('user', '$username', 'Disputing/Claiming the payment', 'system', '1')");
 
                        }
                }
        }
        fclose ($fp);
}
?>
One of the replies states this
Yepp Nathan just tried it out, it looks pretty nice but it's giving me undefined variable on line 115 which I believe is $req can you please tell me what I should do? I will try defining it in lang or global or w.e lol will post with my results
Nope giving me errors lol anyone know how to do this?

So? Will it, Should it Could it, And would it work? If you think or know it doesn't would you mind explaining how to set it up in a well written explanation. I know this post makes hardly any sense :< Anyways,
Thanks in advance.
 

Users who are viewing this thread

Top