foreach ($_POST as $Key => $Value) {
if ($Key <> "Mode" &&
$Key <> "APIMode" &&
$Key <> "Submit" &&
trim($Value) <> '') {
$Value = stripslashes($Value);
if (strtoupper($Value) == 'BLANK') {
$Value = '';
}
echo "
\n";
echo " | $Key | \n";
echo " $Value | \n";
echo "
\n";
$PostFields .= "&" . $Key . "=" . urlencode($Value);
}
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.blahdomain.com/SomeFile.cfm');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $PostFields);
$Result = curl_exec($ch);
curl_close($ch);