libcurl form posting problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

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:

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,

Site Timeline