php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #6080 fsockopen example uses "\n" for HTTP communication
Submitted: 2000-08-10 17:10 UTC Modified: 2000-08-11 19:16 UTC
From: php-bugs at bjoernsworld dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0.1pl2 OS:
Private report: No CVE-ID: None
 [2000-08-10 17:10 UTC] php-bugs at bjoernsworld dot de
| [...]
| 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).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-11 18:51 UTC] hholzgra@php.net
fixed in cvs
 [2000-08-11 19:16 UTC] hholzgra@php.net
... and closed ...
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Mon Jun 15 15:00:01 2026 UTC