0) { $d = mysql_fetch_array($q); if($d['status']!='Completed') { //send the email using the cgi form already created $req = "Submit=Confirm Your Details&custom1=".$tx_token."&function=customer2&un=mvu&firstname=".$d['first_name']." ".$d['last_name']."&email=".$d['payer_email']; // post back to PayPal system to validate $header .= "POST /cgi-bin/maxsponder/maxuseradmin.cgi HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp2 = fsockopen('www.asapinformation.com', 80, $errno, $errstr, 30); if (!$fp2) { $error = ERROR_SERVER_DOWN; } else { fputs ($fp2, $header . $req); } fclose($fp2); } } else { //user wasn't redirected - send the email too //send the email using the cgi form already created $req = "Submit=Confirm Your Details&custom1=".$tx_token."&function=customer2&un=mvu&firstname=".$first_name." ".$last_name."&email=".$payer_email; // post back to PayPal system to validate $header = "POST /cgi-bin/maxsponder/maxuseradmin.cgi HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp2 = fsockopen('www.asapinformation.com', 80, $errno, $errstr, 30); if (!$fp2) { $error = ERROR_SERVER_DOWN; } else { fputs ($fp2, $header . $req); } fclose($fp2); } } mysql_query("UPDATE data set txn_id='".mysql_real_escape_string($tx_token) ."', first_name='".mysql_real_escape_string($first_name)."', last_name='".mysql_real_escape_string($last_name)."', payment_type='".mysql_real_escape_string($payment_type)."', payer_email='".mysql_real_escape_string($payer_email)."', status='".mysql_real_escape_string($payment_status)."' WHERE id='".(int)$custom_id."'"); } fclose ($fp); exit; ?>