rubing Posted July 16, 2008 Share Posted July 16, 2008 I am trying to understand the paypal ipn script, so that I can make something similar. Their script opens a stream with fsockopen and transmits some data stored in variables $header . $req. Then the script waits for a 'VERIFIED' message. I am curious about what is happening on the paypal side. How do you accept a stream from fsockopen and then reply back as Verified?? What would their code look like?? Thx for any help! PayPal Instant Payment Notification Script $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { ...Script goes on to insert Verified data into database table Link to comment https://forums.phpfreaks.com/topic/114950-using-fgets-with-fsockopen/ Share on other sites More sharing options...
ratcateme Posted July 16, 2008 Share Posted July 16, 2008 read this http://devzone.zend.com/article/1086-Writing-Socket-Servers-in-PHP Scott. Link to comment https://forums.phpfreaks.com/topic/114950-using-fgets-with-fsockopen/#findComment-591201 Share on other sites More sharing options...
rubing Posted July 16, 2008 Author Share Posted July 16, 2008 AWESOME! You Rule! Link to comment https://forums.phpfreaks.com/topic/114950-using-fgets-with-fsockopen/#findComment-591561 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.