generaltso Posted December 17, 2008 Share Posted December 17, 2008 I have a script set up that I need to log in to a site. All is well and good, and the site goes to redirect. Lets say that the final result I want to see is this: www.remotesite.com/anydir However, the final result of the cURL is: www.mysite.com/anydir resulting in a 404 error code since I don't have /anydir on my server (it is on the remote server). I have battled with the cURL settings for the past couple days and nothing seems to work. Here is what I have right now: curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_MAXREDIRS, 0); curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookiejar'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookiejar'); curl_setopt($ch, CURLOPT_COOKIE, "cookiejar"); This is frustrating! any help would be appreciated Link to comment https://forums.phpfreaks.com/topic/137447-curl-help-needed-redirect/ Share on other sites More sharing options...
generaltso Posted December 18, 2008 Author Share Posted December 18, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/137447-curl-help-needed-redirect/#findComment-718988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.