Php and curl, url not shown in an https request

From: Date: Thu, 06 May 2004 19:36:49 +0000
Subject: Php and curl, url not shown in an https request
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185547@lists.php.net to get a copy of this message
Hi all, I'm trying to use the curl library to request a page through POST. The page is requested fine, the parameters are passed but the url that is shown in the browser is the url of the previous page, the page that is making the request and not the page that is shown in the redirection. ie: $ch= curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.foo.com"); $arg= Array(); $arg['desc']='something here'; $arg['cartId']='more here'; $arg['submit']="Yes, I want to pay"; $header[]="Location: https://www.foo.com"; curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $arg); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt ($ch, CURLOPT_HTTPHEADER, $header); curl_exec ($ch); curl_close ($ch); the "https://www.foo.com" is requested fine, the parameters are passed alright but the browswer shows the address of the previous page so the lock image of the secure connection isn't shown on the status bar, not to mention all the relative uri now point to the domain of the script that made the request and not to the new page's domain, so it's a mess. thanks a lot for looking at this! Lizet

« previous php.general (#185547) next »