php cURL POST how to follow location

Posted by webfac on Stack Overflow See other posts from Stack Overflow or by webfac
Published on 2010-04-09T11:57:10Z Indexed on 2010/04/09 12:13 UTC
Read the original article Hit count: 387

Filed under:
|

Hi Guys,

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

Related posts about php

Related posts about curl