[REL] Working HTML & PHP Server Status Code

Status
Not open for further replies.
Newbie Spellweaver
Joined
Feb 17, 2007
Messages
7
Reaction score
0
Hey, I decided to make this server status thing :) And it works with PHP and HTML ^-^

HTML Code (can only use default images):
Code:
<img src="http://www.habblissinc.com/junkyhotel/status.php?link=YOURIPHERE:YOURPORTHERE">
PHP Code (can use your own images):
Code:
<?php
//you can change these so they link to any image you want :)
$live = "YOURONLINEIMAGE";
$dead = "YOUROFFLINEIMAGE";

list($addr,$port)= explode (':',"$link");
if (empty($port)){
$port = 90;//can change port to whatever
}

$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
Then put
Code:
<img src="http://www.yourdomain.com/status.php?link=YOURIPHERE&port=YOURPORTHERE">
On your site

Here is how to work the PHP one:
1. Make a file called green.gif and change
'$live = "YOURONLINEIMAGE";' to '$live = "http://yourdomain.com/green.gif";'
2. Make a file called red.gif and change
'$live = "YOURONLINEIMAGE";' to
'$dead = "http://yourdomain.com/red.gif";'
3. Upload
4. Make a PHP File with a name like "status.php"
5. Put the PHP Code into the PHP file
6. Open the
7. Enter your IP where it says "YOURIPHERE
8. Upload
9. Put the:
<img src="http://www.yourdomain.com/status.php?link=YOURIPHERE&port=YOURPORTHERE">
onto a page where you want the server status to appear
(like on your homepage or loader page)
10. Start your server
11. See if it works

Here is how to work the PHP one:
1. Open site you want to put it on
2. Paste the code where it is going to appear for others
3. Add it so it says <img src="http://habblissinc.com/junkyhotel/status.php?link=YOURIPHERE:YOURPORTHERE"> in the Source
4. Start your server
5. See if it works

Example:
Code:
<?php
//you can change these so they link to any image you want :)
$live = "http://habblissinc.com/junkyhotel/green.gif";
$dead = "http://habblissinc.com/junkyhotel/red.gif";

list($addr,$port)= explode (':',"$link");
if (empty($port)){
$port = 90;//can change port to whatever
}

$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
goes onto a page called 'serverstatus.php' then on the page you want to display the server status have
Code:
<img src="http://www.habblissinc.com/junkyhotel/status.php?link=YOURIPHERE:YOURPORTHERE">
 
Last edited:
I Get

Code:
Warning: Cannot modify header information - headers already sent by (output started at /home/habplus/public_html/advertise/status.php:1) in /home/habplus/public_html/advertise/status.php on line 23
 
If the php one isn't working for u just use

<img src="http://www.habblissinc.com/junkyhotel/status.php?link=YOURIPHERE&port=YOURPORTHERE">

Where you want the server status to appear
 
Don't work, it says evertime offline but the Hotel is online :S
Juhnke - [REL] Working HTML & PHP Server Status Code - RaGEZONE Forums
 
It does not make sence!

1. Make a file called green.gif and change
'$live = "YOURONLINEIMAGE";' to '$live = "http://yourdomain.com/green.gif";'

Dose that mean change that and leave the rest of the code?

<?php
//you can change these so they link to any image you want :)
$live = "YOURONLINEIMAGE";
$dead = "YOUROFFLINEIMAGE";

list($addr,$port)= explode (':',"$link");
if (empty($port)){
$port = 90;//can change port to whatever
}

$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
 
example:
Code:
<?php
//you can change these so they link to any image you want :)
$live = "http://habblissinc.com/junkyhotel/green.gif";
$dead = "http://habblissinc.com/junkyhotel/red.gif";

list($addr,$port)= explode (':',"$link");
if (empty($port)){
$port = 90;//can change port to whatever
}

$churl = @fsockopen(server($addr), $port, $errno, $errstr, 20);
if (!$churl){
header("Location: $dead");
}
else {
header("Location: $live");
}
function server($addr){
if(strstr($addr,"/")){$addr = substr($addr, 0, strpos($addr, "/"));}
return $addr;
}
?>
goes onto a page called 'serverstatus.php' then on the page you want to display the server status have
Code:
<img src="http://www.habblissinc.com/junkyhotel/status.php?link=YOURIPHERE:YOURPORTHERE">

@PixelPro123

I like spamming so, stop me!! >:]
 
Status
Not open for further replies.
Back