Advanced Site Status - RMB Scripting
You appear not to have an account with us, Click HERE to register an account...
RMB Scripting
Navigation
  Home
  Contact
  FAQ
  Forum
  Topsites
  Members
  Affiliates
  Arcade <-- New!
  IoxHost
Downloads
  Templates
  Scripts
  Fonts
  Image Sets
  Software
  Other
 
Tutorials
  .htaccess
  Photoshop
  C/C++
  CSS
  Macromedia Flash
  MySQL
  PHP
  PHP - User System
  HTML
  Javascript
  Macintosh
  Macromedia Fireworks
  Visual Basic
  Visual C#
  Windows
  Python
  Other
 
Latest Tutorials
Get the date of every ...
If...Else on one line ...
Drop Calendar Function
Single VS Double
Understanding Variables
Latest Comments
Simple Comment System
Simple Comment System
Simple Comment System
Simple Comment System
Private Message System
Stats
Total Members: 585 [231]
Total Tutorials: 276
Newsest User: zaithstery
Todays Unique Hits: 71
Users Online: 0
 
9 Guests
Poll
Should we change our name?
Hmmmm, Yes!!
Maybe
Depends on what to
NO!
Main Content
Tutorial: Advanced Site Status By ShadowMage
Hello this is a repost of my server status image here on RMB.

First off you will want to make a new file named img.php and in that file code something like:
   
PHP:

<?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$errstr2); //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($pic00$width20$col3); //create rectangle
ImageFilledRectangle($pic11$width-218$col2); //Create teh rectangle for the text and stuff
ImageString($pic352$string$col1); //this is text
ImagePNG($pic); //show image
ImageDestroy($pic); //desolate it
?> 


Next open your .htaccess file and in there put:

   
CODE:

RewriteEngine on
RewriteRule ^stats.png$ img.php


That should work for a demo you can see:
Difficulty: Moderate
Views: 2247
Rating:
Comments
There are currently no comments for this tutorial.
Notice:
Remember to post long codes on our pastbin! - (http://rmb.pastebin.com/)
Add Comment
You must be logged in to post a comment.
Good Morning Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
$2.50 Resellers
Free Domains
Free Games
Affiliates