I have the script below, and it can ping any IP statically put in the file, but when I post to it it always fails.
<?php
$server = $_POST['ip'];
if (!$socket = @fsockopen("$server", 80, $errno, $errstr))
{
echo "<font color='red'><strong>Offline!</strong></font>";
}
else
{
echo "<font color='green'><strong>Online!/strong></font>";
fclose($socket);
}
?>
I’ve added several functions: