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); ?> Link to comment https://forums.phpfreaks.com/topic/227021-paypal-not-working/ Share on other sites More sharing options...
tjverge Posted February 8, 2011 Share Posted February 8, 2011 Try replacing === with == Link to comment https://forums.phpfreaks.com/topic/227021-paypal-not-working/#findComment-1171277 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? Link to comment https://forums.phpfreaks.com/topic/227021-paypal-not-working/#findComment-1171281 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. Link to comment https://forums.phpfreaks.com/topic/227021-paypal-not-working/#findComment-1171294 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. Link to comment https://forums.phpfreaks.com/topic/227021-paypal-not-working/#findComment-1171296 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 Link to comment https://forums.phpfreaks.com/topic/227021-paypal-not-working/#findComment-1171298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.