cURL Cookie and 307 redirect issue

wessam

New Member
I currently have a script that loads a page on my clients other server using cURL. Currently, the settings are\[code\]curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);curl_setopt( $ch, CURLOPT_AUTOREFERER, true );curl_setopt($ch,CURLOPT_USERAGENT,$useragent);curl_setopt($ch, CURLOPT_HEADER, 0);$usecookie = ROOT_PATH . "/public_html/football_parser/cookie.txt";if($usecookie) { if (!is_writable($usecookie)) { return "Can't write to $usecookie cookie file, change file permission to 777 or remove read only for windows."; }curl_setopt($ch, CURLOPT_COOKIEJAR, $usecookie);curl_setopt($ch, CURLOPT_COOKIEFILE, $usecookie); } $output = curl_exec($ch);\[/code\]I'm trying to load the two example urlsstatto.com/football/teams/newcastle-united/2005-2006/resultsandstatto.com/football/teams/newcastle-united/2008-2009/resultsThe second loads without any problems. The first fails to load without \[code\]curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE)\[/code\] being set. When it does load however, it redirects to an error page, but it is fine in my brower. I've been told that there is a 307 redirect on this page that switches between the page I see in my browser and the 404 error page I get in cURL. I can make this error page appear in my browser if I delete the cookie UID, but I've checked the cookie file on my server and it seems to be set ok and present.Can anyone tell me how I would cURL the first url and see what I see in my browser, not the 404 redirect? Many ThanksMichelle
 
Back
Top