PHP-Code:
if (exec("ping www.zimmbi.ch -n 1"))
{
echo "OK";
}
else
{
echo "Error";
}
<?PHP
$iptoopen = "www.zimmbi.ch";
$porttoopen = 80;
$connection = fsockopen ($iptoopen, $porttoopen, &$errno, &$errstr, 1);
if (!$connection){
echo "Can not Connect to port $iptoopen:$porttoopen<br>Error: $errno / $errstr";
}else{
fputs($connection, "\n");
echo "Ok, I'am connected to the port $iptoopen:$porttoopen";
fclose ($connection);
}
?>
Kommentar