I am attempting to use PHP and cURL to:
- Access a web-form & maintain session
- Post the data to that form with session in place
In my head, I see it as two separate functions, one to get the form (initiate session) and another to post the data.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll find this page helpful. In particular, check out
CURLOPT_COOKIE,CURLOPT_COOKIEFILE, andCURLOPT_COOKIEJAR.You should be able to make 2 curl requests in the same php file, one that initiates the form (and grabs your session cookie then places it in your cookie file) and another that POSTS your request (using the same cookies).
Check out the comments further down that page for examples. You might also want to look at the paypal curl examples floating around the web, they do pretty much what you’re after.