Ciao a tutti, sono un po' di giorni che cerco ovunque in rete senza trovare una risposta
Praticamente uso questo script basato su quello postano in una guida su html.it
Ora il problema è che dopo l'acquisto, paypal invia i dati allo script, esso elabora tutto con successo. Ora nasce il problema, cioè che invece di elaborarlo una sola volta viene ri e ri elaborato fino all'infinito.Codice PHP:$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 ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
$custom = filter_var($_POST['custom'], FILTER_SANITIZE_STRING);
$txn_id = filter_var($_POST['txn_id'], FILTER_SANITIZE_STRING);
if (!$fp) {
exit();
} else {
fputs ($fp, $header . $req);
$finish = 0;
while (!feof($fp)) {
if(isset($custom)) {
if($finish == 0){
$cust = explode("|", $custom);
$userid = $cust[0];
$amount = $cust[1];
if(is_numeric($userid) && is_numeric($amount)){
mysql_query("UPDATE users SET crystals = crystals + ".$amount." WHERE id = ".$userid);
$finish = 1;
}
}
}
}
fclose($fp);
}
Ora non capisco se è un problema di developer.paypal.com oppure dello script.![]()
Ringrazio chiunque sappia aiutarmi


Rispondi quotando