Hi all, I want to submit a form (GET) via my script submit.php. This is how the form (testform.php) looks like: <form id="myform" name="myform" method="get" action="final.php?version=MAIN"> <input name="firstname" type="firstname" id="firstname" size="20" /> <input name="preis" type="hidden" value="1.00"> <input type=image alt="submitnow" src="images/submitnow.gif" name=SUBMIT></td> </form> Code (markup): I found this function: function hitForm($loginURL, $loginFields, $referer="") { $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, cookie.txt); curl_setopt($ch, CURLOPT_COOKIEFILE, cookie.txt); curl_setopt($ch, CURLOPT_URL, $loginURL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_REFERER, $referer); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $loginFields); $ret = curl_exec($ch); curl_close($ch); return $ret; } PHP: But I can not get it to work ... By the way: is there any difference in submitting a form (GET) and simply call an url like this: final.php?version=MAIN&firstname=myname etc. ??
You do not need to use CURL. On final.php, the link in the address bar would look like: final.php?firstname=XX&preis=XX Add a hidden field for version=MAIN. Then simple use PHP to handle those values via $_GET global variable. Peace,