Page 1 of 1

Trying to use fsockopen to request a webpage

Posted: Tue Feb 20, 2007 4:39 pm
by impulse()
I'm trying to request a web page from an Apache server using fsockopen but I keep getting the error:

Broken pipe in /ste/a.php on line 7

This is the code:

Code: Select all

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connection = socket_connect($socket, '<IP address of web server");
socket_write($socket, "GET /php/index.php");
echo "Written\n";
socket_close($socket);
Where am I going wrong?

Regards,

Posted: Tue Feb 20, 2007 4:46 pm
by feyd
That doesn't look like fsockopen().