Jump to content

POST-ing to 2 pages?


aphedrone

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.