aidan Thu Feb 24 02:23:59 2005 EDT
Modified files:
/phpdoc/en/reference/sockets/functions socket-bind.xml
Log:
Send a valid http request
http://cvs.php.net/diff.php/phpdoc/en/reference/sockets/functions/socket-bind.xml?r1=1.7&r2=1.8&ty=u
Index: phpdoc/en/reference/sockets/functions/socket-bind.xml
diff -u phpdoc/en/reference/sockets/functions/socket-bind.xml:1.7
phpdoc/en/reference/sockets/functions/socket-bind.xml:1.8
--- phpdoc/en/reference/sockets/functions/socket-bind.xml:1.7 Thu Feb 24
02:09:27 2005
+++ phpdoc/en/reference/sockets/functions/socket-bind.xml Thu Feb 24
02:23:58 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
<refentry id="function.socket-bind">
<refnamediv>
<refname>socket_bind</refname>
@@ -92,7 +92,7 @@
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
// An example list of IP addresses owned by the computer
-$sourceips['kenny'] = '127.0.0.1';
+$sourceips['kevin'] = '127.0.0.1';
$sourceips['madcoder'] = '127.0.0.2';
// Bind the source address
@@ -102,7 +102,9 @@
socket_connect($sock, '127.0.0.1', 80);
// Write
-socket_write($sock, "GET / HTTP/1.1\r\n\r\n");
+$request = 'GET / HTTP/1.1' . "\r\n" .
+ 'Host: example.com' . "\r\n\";
+socket_write($sock, $request);
// Close
socket_close($sock);