I wanted to ask people on facepunch to help but they are a******* there so here goes.
i have a webserver and sql and i have a php from paypal. but what i cant get is how do i send a command after they buy admin/supporter to make them that class?
i mean heres what i got so far
<?php
mysql_connect("****", "****", "****") or die(mysql_error());
mysql_select_db("******") or die(mysql_error());
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
// post back to PayPal system to validate
$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 ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
// PAYMENT VALIDATED & VERIFIED!
function SteamID2CommunityID($steamid)
{
$parts = explode(':', str_replace('STEAM_', '' ,$steamid));
return bcadd(bcadd('76561197960265728', $parts['1']), bcmul($parts['2'], '2'));
}
$email = $_POST['payer_email'];
$password = mt_rand(1000, 9999);
mysql_query("INSERT INTO users (email, password, steamid) VALUES('". mysql_escape_string($email) ."', '".md5($password)."', '"$steamid") or die(mysql_error());
echo exec('ulx adduserid $steamid admin');
}
else if (strcmp ($res, "INVALID") == 0) {
// PAYMENT INVALID & INVESTIGATE MANUALY!
$to = 'seanzilla@hvc.rr.com';
$subject = 'Download Area | Invalid Payment';
$message = '
Dear Administrator,
A payment has been made but is flagged as INVALID.
Please verify the payment manualy and contact the buyer.
Buyer Email: '.$email.'
';
$headers = 'From:noreply@dvcservers.com' . "\r\n";
mail($to, $subject, $message, $headers);
}
}
fclose ($fp);
}
?>
i was wondering if someone can help me