ULX

Author Topic: Donation system  (Read 2804 times)

0 Members and 1 Guest are viewing this topic.

Offline sciaschi

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Donation system
« on: May 28, 2012, 01:05:36 PM »
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
 
Code: [Select]
<?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$errstr30);


if (!
$fp) {
// HTTP ERROR
} else {
fputs ($fp$header $req);
while (!
feof($fp)) {
$res fgets ($fp1024);
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(10009999);

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
« Last Edit: May 28, 2012, 01:07:09 PM by sciaschi »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Donation system
« Reply #1 on: May 28, 2012, 07:44:37 PM »
See if this helps at all.. Not sure if it still works well or not as I wrote it a while back and haven't had much time to play with it.
http://forums.ulyssesmod.net/index.php/topic,5188