TechieTW Posted November 6, 2006 Share Posted November 6, 2006 I am using an external download processor that needs to verify purchase of an item. I am trying to send the $payer_email and $item_number to another url from inside ipn.php. I placed my script in between line 111 & 112 of ipn.php. It looks something like this: echo "<script type='text/javascript'>location.href ='http://mydomain.com/specialfolder/myverifypurchase.php?email=$payer_email&item=$item_number';</script>"; My order is changed to VERIFIED, but my data does not send. Can anyone help me with the placement or perhaps a better syntax to use for the data transfer? This one really has me stumped. Quote Don't give up. I see light ahead...! Link to comment Share on other sites More sharing options...
dynamoeffects Posted November 6, 2006 Share Posted November 6, 2006 I don't know IPN that well, but unless a human opens that page in a javascript enabled browser will that code ever run. For this, you'll need PHP an the easiest way (read: least code) would be with file_get_contents: $null = file_get_contents('http://mydomain.com/specialfolder/myverifypurchase.php?email=' . $_GET['payer_email'] . '&item=' . $_GET['item_number'], false); $null = NULL; Now, this is assuming that those variables are passed in the URL to IPN, so it might work, it might now, but it'll get you started. Quote Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail. Link to comment Share on other sites More sharing options...
TechieTW Posted November 6, 2006 Author Share Posted November 6, 2006 Basically I am trying to send data FROM ipn.php TO another .php page at a different location on my site. The URL (for example's sake) is http://mydomain.com/specialfolder/myverifypurchase.php The data I am trying to send is variable definitions from the Paypal IPN data. Maybe I'm not understanding the syntax but doesn't this command READ? How would I send the data? I'm sorry, I'm new to PHP. Also, is there an E-Book out there that you could recomend? One that I can download right away? Thanks for your quick reply and recommendation. Quote Don't give up. I see light ahead...! Link to comment Share on other sites More sharing options...
dynamoeffects Posted November 6, 2006 Share Posted November 6, 2006 In order to read the webpage, you have to send data. Since you're calling the page with IPN's variables added to the URL, the information is passed to your target file and ipn.php simply discards whatever data's sent back. You could have the myverifypurchase.php file print a success or error message and then have ipn.php interpret that value to know if it was successful or not. Simply put, it's a few lines shorter than using cURL and it'll do the same thing. Quote Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail. Link to comment Share on other sites More sharing options...
TechieTW Posted November 8, 2006 Author Share Posted November 8, 2006 Thanks for clarifying. Do you know where in the post payment process I can safely redirect the buyer to my download page? (what .php file and if possible, what line?) I'm reading/learning as I go with this modification. I just don't want to redirect until the order and it's details have been used by osCommerce. I want to inject my redirect right after that process is done but before the continue button is clicked. (if possible). Thanks again for your time. Quote Don't give up. I see light ahead...! 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.