$value) {
$value = urlencode(stripslashes($value));
$QueryString .= "&$key=$value";
}
// congfigure our headers
$header = "POST /bin/dumplinks.asp?" . $QueryString . " HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($PostingString) . "\r\n\r\n";
// open a connection to PowerLinks
$fp = fsockopen ('www.powerlinks.com', 80, $errno, $errstr, 30);
if (!$fp) {
// HTTP ERROR
echo "Error processing request";
} else {
// send form headers, form post
fputs ($fp, $header . $PostingString);
// set our returned header flag to true, these we want to ignore
// initialize our body variable
$bHeader = true;
$sData = "";
while (!feof($fp)) {
$res = fgets ($fp, 8192);
$res = ereg_replace("[\r\n]", "", $res);
// if we have an empty line, we are now past the headers.
// set the flag so we can start retrieving data
if (strlen($res) == 0) $bHeader = false;
if ($bHeader == false) $sData .= $res;
}
echo $sData;
fclose ($fp);
}
?>
|
|
|