Trying to use fsockopen to request a webpage
Posted: Tue Feb 20, 2007 4:39 pm
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:
Where am I going wrong?
Regards,
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);Regards,