zang8027 Posted February 13, 2009 Share Posted February 13, 2009 I got paypal sending back information to my site "behind the scene" (never opens up the page.. user never sees it happen) and that voids any session or cookies that I am using. Any way I can open a page once this page is hit? Once an order is complete, it sends to paypal_ipn.php Once it hits that page.. can i have another page from my site open up? May be javascript... not sure Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/ Share on other sites More sharing options...
samshel Posted February 13, 2009 Share Posted February 13, 2009 generally that page is made as back ground on purpose as it is not fixe "when" paypal will hit it back. it has to be an asychronous activity. You can update database when this page is hit by paypal. Then you can open up pages and show status depending upon data in the database. Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/#findComment-760960 Share on other sites More sharing options...
coder_ Posted February 13, 2009 Share Posted February 13, 2009 That "behind the scene" technology you need is AJAX. You just send an AJAX request with all needed data (through GET or POST method) and your "behind the scene" php script will do all the work and return respond to browser. If i understand what you are trying to say... Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/#findComment-760961 Share on other sites More sharing options...
zang8027 Posted February 13, 2009 Author Share Posted February 13, 2009 hmm see this is the page PAYPAL hits once the payment is complete: <?php session_start(); //We need to first grab the information being passed from paypal $date = $_REQUEST['payment_date']; $cost = $_REQUEST['mc_gross']; $myFile = "./payments.log"; $fh = fopen($myFile, 'a') or die("Cannot Connect to Log"); $v = "This was sent over: Order costs:$cost on $date \n"; fwrite($fh, $v); fclose($fh); ?> i have sessions for restaurant and user but since this is happening behind scenes.. then the session voids like i said.. so how can i add this stuff to DB and know which to pull out? Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/#findComment-760962 Share on other sites More sharing options...
samshel Posted February 13, 2009 Share Posted February 13, 2009 you will have to store all that information in database and pass the unique id of that (say order_id) to paypal ipn URL like paypal_ipn.php?order_id=12345 so when paypal hits back this page, you can retrieve all information you want from database do your stuff and update database back.. Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/#findComment-760964 Share on other sites More sharing options...
zang8027 Posted February 13, 2009 Author Share Posted February 13, 2009 the only option i have from paypal is: Enter your URL that the ipn will be sent: [ ] There is no place that I can add a random parameter that would be different each time. :-/ Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/#findComment-760970 Share on other sites More sharing options...
samshel Posted February 13, 2009 Share Posted February 13, 2009 you can add it in your form script which you use to redirect to paypal. Link to comment https://forums.phpfreaks.com/topic/145018-opening-a-page-from-behind-the-scene/#findComment-760972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.