First off you will want to make a new file named img.php and in that file code something like:
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); //Expiration Date
Header("Content-type: image/png"); //image type
$width=300; //change this if you must
$height=20; //change if you want but id leave
$ip = "IPHERE"; //change to yourip
$port = "PORT HERE"; //change to server port
$connectXD = @fsockopen($ip, $port, $errno, $errstr, 2); //connection through fsock
if($connectXD){ //if its available
//background color is white
$c2r=255;
$c2g=255;
$c2b=255;
//text is green
$c1r=0; //red
$c1g=125; //green
$c1b=0; //blue
$string = "Online"; //Online text :D
}else{ //uh ohs!!!
//background is white
$c2r=255; //red
$c2g=255; //green
$c2b=255; //blue
//text is red
$c1r=255; //red
$c1g=0; //green
$c1b=0; //blue
$string = "Offline Check Back Soon!"; //Offline text
} //end else if for checking
//Border color is greenish
$c3r=0; //red
$c3g=128; //green
$c3b=0; //blue
$pic=ImageCreate($width,$height); //create the image
$col1=ImageColorAllocate($pic,$c1r,$c1g,$c1b); //text
$col2=ImageColorAllocate($pic,$c2r,$c2g,$c2b); //background
$col3=ImageColorAllocate($pic,$c3r,$c3g,$c3b); //border
ImageFilledRectangle($pic, 0, 0, $width, 20, $col3); //create rectangle
ImageFilledRectangle($pic, 1, 1, $width-2, 18, $col2); //Create teh rectangle for the text and stuff
ImageString($pic, 3, 5, 2, $string, $col1); //this is text
ImagePNG($pic); //show image
ImageDestroy($pic); //desolate it
?>