Jump to content

Signature to show if server is up or down.


Cyberpawz

Recommended Posts

Ok, day one here and I got a huge question.

I own a server, and yes ok I know I'm going to get hammered here but I'm on a Mac... :P

In any case, here are my server stats for the info... now don't expect much to be different on a Mac or PC when it comes to Apache and the rest, it's all still server side fun stuff...

PHP Version 4.3.9

Apache Version 2.0.52

MySQL Version 4.0.17

Yes I know some is out of date, but the issue is that there is a new version coming out soon for the Mac and I'm waiting till it goes to stable version, and not beta...

Now here is my question...

I see these signatures with images saying "Your IP, etc is"...

I'm looking to do something a little different. What I'm looking to do is to make a script that would say is a server is up and running... and if it's not to point to another server and say the server is down...

So it will be something like this:

If the server is up, and can access the script the message will say:

The server is up (with a green light)

If the server is down, it then it would point to another server and on the signature it would say:

The server is down (with a red light)

And with that there will be an image or animation in the background that will "envelop" this text...

Is this even possible? And if so how?

Thanks for the help it would be greatly appreciated :)

Link to comment
Share on other sites


I found this scrip, I want to know how would I make this into something like the :your IP: sigs?

Also there are things in here I know I am missing, can someone please help me, unthankfully I'm not a PHP guru...

<?php

$live = "http://www.cyberpawz.com/status/live2.gif";

$dead = "http://www.cyberpawz.com/status/dead.gif";

//The status checking script

//meddle at your own risk!

//check for port number, default is 80

$link = $_GET['link'].":";

$s_link = str_replace("::", ":", $link);

list($addr,$port)= explode (':',"$s_link");

if (empty($port)){

$port = 80;

}

$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);

             if (!$churl){

    //echo $errstr;

                header("Location: $dead");

                }

             else {

                header("Location: $live");            

    }

function server($addr){

         if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}

         return $addr;

}

?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...