Connecting Tech Pros Worldwide Help | Site Map

libcurl form posting problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:16 PM
chad.arimura@gmail.com
Guest
 
Posts: n/a
Default libcurl form posting problem

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.