View Full Version : simulating a submit button

10-16-2012, 10:54 PM
i want to make a script that will simulate submit button function if a certain condition is satisfied,i researched a bit and i found that i need to do it with php's curl functions...i sniffed what submit button does and what fields it produces,here is a picture of the sniffed submit button...can you help me make a curl script?


10-17-2012, 12:24 AM
All the submit button is, is an input with the name and value. You simply need to provide that name => value combination with a part of the form data in a curl.

10-17-2012, 12:57 PM
but what about this last field,is it a cookie?

10-17-2012, 02:21 PM
I'm not familiar with the Joomla JXTC appointment book system but the last one looks like it's just a token (probably session-specific) that the page generates in order to validate the user to prevent people sending submit data to them "in the blind." You will probably have to visit their page once to get the token, and then again to submit the data.

Whether that particular variable comes from a cookie or not, I can't say (I have no idea how you generated your table of data) but your cURL can be set to use cookies if needed so you will eventually be good to go either way. You'll just have to feel it out.

10-17-2012, 03:24 PM
i generated this table from fiddler,i sniffed what submit button did so i can make my curl script...this is my script that doesnt work...

$curl_connection =curl_init('here is the site where i want this script to process');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);



=>i have put put fields like this just for test<=

foreach($post_data as $key =>$value){

curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);