aphedrone Posted June 16, 2010 Share Posted June 16, 2010 Ok, here's my issue: I have an order confirmation page (A), an order process page (B) and then an external payment gateway ©. So I need to have the user confirm the order on A, I'm POST-ing all the info to B (writes the order in the database) but then I need to POST again all the info to C. The thing is B is invisible for the user, the page just writes what have been POST-ed from A and then just redirects to C. So there's no way I can re-POST everything from B to C using another form. How can I do this? Or do you have a better idea of a road map? God bless you Link to comment https://forums.phpfreaks.com/topic/204974-post-ing-to-2-pages/ Share on other sites More sharing options...
shadiadiph Posted June 16, 2010 Share Posted June 16, 2010 Add the variables to the header header("location:blah.php?user=$user&data=$data"); then use user=$_GET['user'] on page C Link to comment https://forums.phpfreaks.com/topic/204974-post-ing-to-2-pages/#findComment-1073094 Share on other sites More sharing options...
aphedrone Posted June 16, 2010 Author Share Posted June 16, 2010 I can't buddy, modifying C is out of my control, as I said is an external payment gateway. They don't give a shit about my problems C only accepts POST. Link to comment https://forums.phpfreaks.com/topic/204974-post-ing-to-2-pages/#findComment-1073095 Share on other sites More sharing options...
Cagecrawler Posted June 16, 2010 Share Posted June 16, 2010 You can use cURL to POST to page C. $ch = curl_init(); $data = array('fieldA' => 'valueA', 'fieldB' => 'valueB'); curl_setopt($ch, CURLOPT_URL, 'http://my.payment.gateway/process'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_exec($ch); Link to comment https://forums.phpfreaks.com/topic/204974-post-ing-to-2-pages/#findComment-1073112 Share on other sites More sharing options...
aphedrone Posted June 16, 2010 Author Share Posted June 16, 2010 I can't. The user needs to be on C page to fill out his cc data. I'm thinking to have A POST directly to C and in the same time CURL to B. I'll try this and see how it works. Thanks for your quick replies. You're a great crowd Link to comment https://forums.phpfreaks.com/topic/204974-post-ing-to-2-pages/#findComment-1073118 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.