hello
i want to be able to send a packet to a http server and receive the
response, but i'm not quite sure how to do it. i thought of using
sockets, and although i have worked out how to send data to the http
server, i have no idea how to receive the responses.
any help wuld be greatly appreciated.
this is what i've got so far. i know that the server is receiving the
data because i have employed this technique before, only previously i
did not need to receive the response.
<?php
function login()
{
$data = "POST /admin/default.asp HTTP/1.1\r\n";
$data .= etc etc etc
$socket = socket_create(A F_INET,SOCK_STR EAM,SOL_TCP);
$connection = socket_connect( $socket,'(*IP ADDRESS*)','80' );
socket_write($s ocket,$data);
socket_close($s ocket);
}
login();
?>
i want to be able to send a packet to a http server and receive the
response, but i'm not quite sure how to do it. i thought of using
sockets, and although i have worked out how to send data to the http
server, i have no idea how to receive the responses.
any help wuld be greatly appreciated.
this is what i've got so far. i know that the server is receiving the
data because i have employed this technique before, only previously i
did not need to receive the response.
<?php
function login()
{
$data = "POST /admin/default.asp HTTP/1.1\r\n";
$data .= etc etc etc
$socket = socket_create(A F_INET,SOCK_STR EAM,SOL_TCP);
$connection = socket_connect( $socket,'(*IP ADDRESS*)','80' );
socket_write($s ocket,$data);
socket_close($s ocket);
}
login();
?>
Comment