|
Posted by lawrence k on 10/16/38 11:47
yawnmoth wrote:
> Try this, instead:
>
> POST /errors/index.htm HTTP/1.1
> Host: www.publicdomainsoftware.org
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 1200
> Connection: close
>
> %3C%2Fdiv%3E
>
> Note how there are two new lines between the last HTTP header and the
> actual data. Also... the Content-Length field doesn't look correct.
> strlen(urldecode('%3C%2Fdiv%3E')) is definitly not 1200...
It's curious, but fsocketopen takes forever. It's basically unuseable
for me. It brings the site to a standstill. My code is taken straight
from an example on www.php.net:
$message = rawurlencode($message);
$message = "&errorInput=$message";
$length = strlen($message);
$fp = fsockopen("www.publicdomainsoftware.org", 80, $errno, $errstr,
30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "POST /errors/errorInput.php HTTP/1.1\r\n";
$out .= "Host: www.publicdomainsoftware.org\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Content-Length: $length\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= "$message";
fwrite($fp, $out);
while (!feof($fp)) {
// echo fgets($fp, 128);
}
fclose($fp);
}
The variable $message is just the parameter being passed in. This code
can take 4 or 5 minutes to work, and then finally the pages, often,
just time out.
Any idea why that might be?
Navigation:
[Reply to this message]
|