note 39511 deleted from function.fsockopen by irchtml
| From: | irchtml@php.net | Date: | Wed, 21 Apr 2004 20:32:36 +0000 |
| Subject: | note 39511 deleted from function.fsockopen by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68479@lists.php.net to get a copy of this message | ||
Note Submitter: mjokost@yahoo.com
----
[Edit: There are functions to do that. See http://php.net/rawurlencode and http://php.net/urlencode ]
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.