PHP Server Status Script
Simple server status script enables you to check the status of your server using php.
Features
- Allows visitors to monitor whether server status is online or offline by entering their domain name or IP address.
- It enables you to view current status of your server.
- Visitor can check one server status at a time.
- Can be used in all modern browsers.
Preview
Php Server Monitor Script
Downloads
<?php
error_reporting(0);
function get_server_status($value){
$check = explode(".", $value);
$status = "Server Status :";
if (is_numeric($check[0])) {
if (!filter_var($value, FILTER_VALIDATE_IP) === false) {
$socket = @fsockopen($value, 80, $errorNo, $errorStr, 3);
if(!$socket)
$output = "<font style='color:red;font-weight:bold;'>OFFLINE</font>";
else
$output = "<font style='color:green;font-weight:bold;'>ONLINE</font>";
}
else{
$output = "<font style='color:red;font-weight:bold;'>$value is not a valid IP address</font>";
}
return $output;
}
else {
if(filter_var(gethostbyname($value), FILTER_VALIDATE_IP))
{
$socket = @fsockopen($value, 80, $errorNo, $errorStr, 3);
if(!$socket)
$output = "<font style='color:red;font-weight:bold;'>OFFLINE</font>";
else
$output = "<font style='color:green;font-weight:bold;'>ONLINE</font>";
}
else{
$output = "<font style='color:red;font-weight:bold;'>$value is not a valid Domain</font>";
}
return $output;
}
}
$status = get_server_status("hscripts.com");
echo "<div align=center>Server Status : $status</div>";
?>
- Release Date - 25-07-2015
- Get free version without ©copyright link for just $10/-
- For customization of this script or any script development, mail to support@hscripts.com
Usage
- Copy and paste the above code in your webpage.
- The function get_server_status used to monitor the status of your server by entering the Domain name or IP address.
- Simple php script monitors the status of your server.
License
Related Scripts