diff --git a/reference/network/functions/fsockopen.xml b/reference/network/functions/fsockopen.xml index 782fe5fdb4..151b58adfc 100644 --- a/reference/network/functions/fsockopen.xml +++ b/reference/network/functions/fsockopen.xml @@ -1,5 +1,5 @@ - + @@ -78,7 +78,11 @@ $fp = fsockopen ("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)
\n"; } else { - fputs ($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\n\r\n"); + $out = "GET / HTTP/1.1\r\n"; + $out .= "Host: www.example.com\r\n"; + $out .= "Connection: Close\r\n\r\n"; + + fputs ($fp, $out); while (!feof($fp)) { echo fgets ($fp,128); }