MSFN Forum: Signature to show if server is up or down. - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Signature to show if server is up or down. Just as the topic says :p Rate Topic: -----

#1 User is offline   Cyberpawz 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 25-May 05

Posted 25 May 2005 - 02:43 PM

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 :)


#2 User is offline   gamehead200 

  • SEARCH!!! SEARCH!!!
  • Group: Super Moderator
  • Posts: 7,034
  • Joined: 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 25 May 2005 - 03:12 PM

Its possible using PHP...

Go to http://hotscripts.com and look for a script that can ping a server and tell you if its online or offline... ;)

Instead of text, you can tell it to output an image! ;) Very easy to do!

#3 User is offline   Cyberpawz 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 25-May 05

Posted 25 May 2005 - 03:19 PM

gamehead200, on May 25 2005, 05:12 PM, said:

Its possible using PHP...

Go to http://hotscripts.com and look for a script that can ping a server and tell you if its online or offline... ;)

Instead of text, you can tell it to output an image! ;)  Very easy to do!
<{POST_SNAPBACK}>



I hate to sound like a noobie, but how do I actually make it work as a signature?

#4 User is offline   Cyberpawz 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 25-May 05

Posted 25 May 2005 - 03:25 PM

Also I've looked at the site already it has a good concept, but nothing like what I was looking for originally... that is sort of why I asked here :)

#5 User is offline   Cyberpawz 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 25-May 05

Posted 25 May 2005 - 04:43 PM

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...


Quote

<?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;
}
?>


#6 User is offline   gamehead200 

  • SEARCH!!! SEARCH!!!
  • Group: Super Moderator
  • Posts: 7,034
  • Joined: 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 25 May 2005 - 05:03 PM

Before even playing around with these scripts, I suggest reading up a bit on PHP that way you can get the hang of it.

What you found WILL work... Just put it in a PHP file and link to it. :)

#7 User is offline   Cyberpawz 

  • Newbie
  • Group: Members
  • Posts: 21
  • Joined: 25-May 05

Posted 26 May 2005 - 12:32 PM

gamehead200, on May 25 2005, 07:03 PM, said:

Before even playing around with these scripts, I suggest reading up a bit on PHP that way you can get the hang of it. 

What you found WILL work... Just put it in a PHP file and link to it. :)
<{POST_SNAPBACK}>



Only problem I see is this, it's using images inside what would placed inside an image correct?

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy