2009-10-12, 10:31 PM
I found this code for Server status chcker:
The page I want it to show the status is the Ticket System page.
This system have the offline.php(for offline system) and index.php( for online system) all at ./support
Tell me what information do you need and I'll post it here.
Here is the code that check if the page is online or not:
And here is the code in the index.php that redirect the user to the offline.php page if the system is closed:
<?
$ip = "youriphere";
$port = "yourporthere";
if (! $sock = @fsockopen($ip, $port, $num, $error, 5))
echo '<B><FONT COLOR=red>Offline</b></FONT>';
else{
echo '<B><FONT COLOR=lime>Online</b></FONT>';
fclose($sock);
}
?>
Is there any way to make this code link with another page that I have?The page I want it to show the status is the Ticket System page.
This system have the offline.php(for offline system) and index.php( for online system) all at ./support
Tell me what information do you need and I'll post it here.
Here is the code that check if the page is online or not:
//Check the status of the HelpDesk.
if(!is_object($cfg) || !$cfg->getId() || $cfg->isHelpDeskOffline()) {
include('./offline.php');
exit;
}
And here is the code in the index.php that redirect the user to the offline.php page if the system is closed:
<?
require_once('client.inc.php');
if($cfg && !$cfg->isHelpDeskOffline()) {
@header('Location: index.php'); //Redirect if the system is online.
include('index.php');
exit;
}
?>