post form with cURL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hnmxport
Forum Newbie
Posts: 2
Joined: Fri Feb 05, 2010 10:54 pm

post form with cURL

Post by hnmxport »

hey coders, i'm sure this question has been asked a million ways by now, but i havent quite found the exact answer i need. I'm trying to submit a form using a text link as apposed to a button. I understand i need to use curl. I think igot that part. what i dont understand is the data i pass to " curl_setopt($ch, CURLOPT_POSTFIELDS, $post_str); " should be urlencoded and that string i get looping through my array of data. My question is how do i get the data from the form fields to a variable that i can use in the array without submitting the form
basically this:
1 user goes to the page
2user fills out form
3 user clicks text link instead of button to submit form
4 link goes to my php page where my cURL/Php script lives
Question : how do i get my values from the form fields in to my assoc.array (that will turn into my urlencoded string) if the user didnt click a submit button but instead it was a text link. how does the form know when to set the $_POST[] variables.

thanks in advance. you guys are great.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: post form with cURL

Post by Christopher »

You don't need cURL, just use Javascript to have the link submit the form.
(#10850)
Post Reply