Connecting Tech Pros Worldwide Help | Site Map

libcurl form posting problem

  #1  
Old July 17th, 2005, 01:16 PM
chad.arimura@gmail.com
Guest
 
Posts: n/a
Hey all,

I've been trying to write a short script using curl w/ php but can't
figure something out:

I'm simply trying to login to a website using a posted user/pass combo
to an html form (login.php) that, if correct, sends a Header("Location:
success.php").

The problem I'm running into is when I successfully login, i'm watching
the logs and it's actually executing success.php but after that's done
the screen just refreshes and stays on login.php... does this have
anything to do with the session variables that are written to tell the
system that I should be logged in?

Does this make sense? Below are my opts.

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$curl_output=curl_exec ($ch);
curl_close ($ch);

echo $curl_output;


Thanks a ton,
Chad

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
CURL form posting to self referencing form action Dave Martin answers 9 July 17th, 2005 10:59 AM