All pastes #753150 Raw Edit

Using CURL to make remote HTTP c

public php v1 · immutable
#753150 ·published 2007-10-29 00:06 UTC
rendered paste body
        foreach ($_POST as $Key => $Value) {            if ($Key <> "Mode" &&                $Key <> "APIMode" &&                $Key <> "Submit" &&                trim($Value) <> '') {                $Value = stripslashes($Value);                if (strtoupper($Value) == 'BLANK') {                    $Value = '';                }                echo "    <tr>\n";                echo "        <td>$Key &nbsp; </td>\n";                echo "        <td>$Value</td>\n";                echo "    </tr>\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);