post form with cURL
Posted: Fri Feb 05, 2010 11:55 pm
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.
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.