php cURL POST how to follow location
Posted
by
One Stuck Pixel
on Stack Overflow
See other posts from Stack Overflow
or by One Stuck Pixel
Published on 2010-04-09T11:57:10Z
Indexed on
2012/09/18
9:38 UTC
Read the original article
Hit count: 181
I am in a bit of a rut with a cURL issue. The post works greate, the data is POSTED just fine and received ok, but the url of the posted page never appears in the browser after the cURL session is executed, for example look at the following code:
$ch = curl_init("http://localhost/eterniti/cart-step-1.php");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "error=1&em=$em&fname=$fname&lname=$lname&email1=$email1&email2=$email2&code=$code&area=$area&number=$num&mobile=$mobile&address1=$address1&address2=$address2&address3=$address3&suburb=$suburb&postcode=$postcode&country=$country");
curl_exec($ch);
curl_close($ch);
The post works fine and I am taken to the cart-step-1.php where I can process the posted data, HOWEVER the location in the URL address bar of the browser remains that of the script page, in this case proc_xxxxxx.php
Any ideas how to get the URL address to reflect the page I am actually POSTED to?
Thanks a mill
© Stack Overflow or respective owner