PHP 4.0 Bug #6080: fsockopen example uses "\n" for HTTP communication
| From: | php-bugs at bjoernsworld dot de | Date: | Thu, 10 Aug 2000 21:10:02 +0000 |
| Subject: | PHP 4.0 Bug #6080: fsockopen example uses "\n" for HTTP communication | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28392@lists.php.net to get a copy of this message | ||
From: php-bugs@bjoernsworld.de
Operating system:
PHP version: 4.0.1pl2
PHP Bug Type: Documentation problem
Bug description: fsockopen example uses "\n" for HTTP communication
| [...]
| fputs ($fp, "GET / HTTP/1.0\n\n");
| [...]
lineendsequenz for HTTP messages is CRLF and not "\n".
see RFC 2616 and
perldoc perlport for this issue.
People use this example to perform HTTP requests and think they do the right thing ('the manual
says ...').
CRLF (0x0d 0x0a) should be used instead (and a 'Host:' header could be added).