Hello DaniWeb, I was wondering how I can have a server status in the Title bar. Such as: (Website name) - Server is online! or (Site Name) Server is offline!

Recommended Answers

All 3 Replies

Have you considered that if the server is offline, how would it serve a web page telling the user such?

R.

Member Avatar for rajarajan2017

Why you not pass the variable value that was your status to the title heading. Its possible.

If you want to display the online/offline information on another website or server, you could try

<html> 

<head> 
<title>
<?php
function GetServerStatus($URL, $PORT)
{
$status = array("OFFLINE", "ONLINE");
$fp = @fsockopen($site, $port, $errno, $errstr, 2);
if (!$fp) {
    return $status[0];
} else
  { return $status[1];}
}
?>
</title> 
</head>

<body>
Bla Bla Bla

</body>

Calum

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.