Trying to set up a script to send commands to a remote client on a Win32 system. Here is the code:
$command = $_POST['command'];
$host = $_POST['host'];
$port = $_POST['port'];
$fp = @fsockopen($host, $port, $e, $s, 15);
if (!$fp) {
echo 'Error! Here\'s your problem: ' . $e . ': ' . $s;
}else{
$fw = fwrite($fp, $command);
if (!$fw){
echo 'Failed sending command.';
fclose($fp);
}else{
fclose($fp);
echo 'Successfully sent: ' . $command;
}
}
My buddy is working on the remote client, and he says that this script is sending ''
However, my script is echoing Successfully sent: test
Am I doing something wrong, or is it a problem on his end?