Jul 29th, 2010, 5:13 PM
Alright, so that didn't work. If I fill out my second form it thanks me for my test submit but it doesn't work when I try to post from my initial php script. Here is the code I'm using, am I doing something wrong?
Quote:// Get the post data from html form just filled out
$postdata = file_get_contents("php://input");
if($_POST['tos'] != "on")
{
echo("<h2>You MUST accept the Terms of Service to submit this form</h2>");
die();
}
//Connect to second form
$curl_connection =
curl_init('http://www.youawfulme.com/secondform.html');
//Set options
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);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $postdata);
//perform our request
$result = curl_exec($curl_connection);
//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);