dahype Posted September 18, 2009 Share Posted September 18, 2009 Hello buddies, i got some problems writing a php that has to login to a https page and then perform some actions. When i run it from my hosting i get this error Not Found The requested URL /hosting.com/page.php was not found on this server. I used LiveHTTP Headers add-on for mozilla to get the steps right and i saw that "page.php" is the page to which the user is redirected to after logging in. Obviously that page cannot be found on MY hosting because it's on the server where i do the log in. How can i solve that? The code i am using for that is the following: <?php $face_cookie = "cookiefb.txt"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://loggingpage.com/index.php'); curl_setopt($ch, CURLOPT_POSTFIELDS,'field1=xxx&field2=XXX&field3=XXX'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_COOKIEJAR, $face_cookie); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); echo curl_exec($ch); ?> any ideas? thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.