unemployment Posted February 8, 2011 Share Posted February 8, 2011 For some reason I can't get this script working for my IPN. Please help. <?php include("init.inc.php"); $send = 'cmd=_notify-validate&' . http_build_query($_POST); $head = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n"; $head .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n"; $head .= 'Content-Length: ' . strlen($send) . "\r\n\r\n"; $fp = fsockopen('sandbox.paypal.com', 80); if ($fp !== false){ fwrite($fp, $head . $send); $response = stream_get_contents($fp); $response = trim(end(explode("\n", $response))); if ($response === 'VERIFIED' && $_POST['payment_status'] === "Completed" && $_POST['mc_gross'] === "10.00" && $_POST['mc_currency'] === "USD") { $payer_email = $_POST['payer_email']; $q = mysql_query("UPDATE `users` SET `test` = '1' WHERE `email` = '$payer_email'"); } } fclose($fp); ?> Quote Link to comment Share on other sites More sharing options...
tjverge Posted February 8, 2011 Share Posted February 8, 2011 Try replacing === with == Quote Link to comment Share on other sites More sharing options...
requinix Posted February 8, 2011 Share Posted February 8, 2011 Have you tried basic debugging techniques? Like printing out values and manually checking them? Quote Link to comment Share on other sites More sharing options...
unemployment Posted February 8, 2011 Author Share Posted February 8, 2011 Try replacing === with == That didn't work. Quote Link to comment Share on other sites More sharing options...
unemployment Posted February 8, 2011 Author Share Posted February 8, 2011 Have you tried basic debugging techniques? Like printing out values and manually checking them? Yeah, i've tried a few. I'm not sure what I am doing wrong. Quote Link to comment Share on other sites More sharing options...
unemployment Posted February 8, 2011 Author Share Posted February 8, 2011 Have you tried basic debugging techniques? Like printing out values and manually checking them? Yeah, i've tried a few. I'm not sure what I am doing wrong. I just debugged my query in mysql and that is working correctly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.