Simple site/server uptime check

phool4fool

203.***.***.***
1,379 days ago

Simple site/server uptime check

This is a simple script for checking whether or not a certain site or server (or even a particular public service) is down or online.

PHP Example:

PHP code:

<?php

// Replace the site with an IP if you wish, or change the port to check different services.
$host = 'netcode.net';
$port = 80;

if ($check = fsockopen($host, $port))
{
echo $host . ' is up';
}
else
{
echo $host . ' is down';
}

?>