note 39511 added to function.fsockopen
| From: | mjokost at yahoo dot com | Date: | Fri, 30 Jan 2004 23:40:04 +0000 |
| Subject: | note 39511 added to function.fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64463@lists.php.net to get a copy of this message | ||
If, when you're working against a web server, you get a 400 Bad Request, it might be because
you have spaces in the URI. Spaces should be replaced with %20 like so:
function requestFromWebServer($document) {
$document = str_replace(" ", "%20", $document);
$request = "GET /$document HTTP/1.0\r\n" .
"Connection: Close\r\n" .
"\r\n";
//...
}
There are probably other characters that need to be replaced too.
----
Manual Page -- http://www.php.net/manual/en/function.fsockopen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39511
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39511&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39511&report=yes
Search -- http://master.php.net/manage/user-notes.php