![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||
|
Checking Your Server Status
This a pretty simple script that will check the status of your server, or it can be used so that anyone can enter the IP or domain of there server and it will check all the common ports. Here is an example: http://status.eX13.net The Code: PHP Code:
ok well simple all this does is open a connection to "$ip" on port 80, and then if $up (if the connection was successful) it will echo Online if not it will echo Offline. If you wanted to use the code for just one server you can replace $ip with either the domain name or the IP. If using the domain name you do not include http:// you would just type domainname.com The $errno and $errstr are both standard error parameters. The last number "30" is how long the connection should stay open until it is classed as timed out. If you wanted to make it so that anyone can check the status of there site all you would do is at the top of the page add: PHP Code:
What this does is retrieve the posted variable "$ip" and checks if the variable is empty if nothing was entered the script will terminate if something is entered the script will simply carry on what it is meant to be doing. Now all that needs to be done is too add a form at the top of the page. The form needs a textbox field and a submit button. PHP Code:
This form will show a text box where anyone can enter any the domain or IP and then when the Submit button is click it will post the data into its self using the command: PHP Code:
Then the posted information will replace the variable $ip. You could use the code to show more than one port. By simply using the same "fsockopen" command but changing the Port number. Heres a list of command ports: HTTP - 80 FTP - 21 SSH - 22 MYSQL - 3306 CPANEL - 2082 WHM - 2086 POP3 - 110 SMTP - 25 Im sure this code will come in handy for someone.
__________________
http://img76.imageshack.us/img76/6450/sc2but4ng.gif | http://img495.imageshack.us/img495/...ogorwtan0je.gif | <a href="http://webtools.sc2.info"><img src="http://img129.imageshack.us/img129/8682/sc2webtan7ju.gif" border="1" width="100" alt="Free Webtools for all" /></a> | <a href="http://www.indexrated.com"><img src="http://img398.imageshack.us/img398/4813/listed1pb.gif" border="1" width="100" alt="Index Rated Directory - Rating Quality Sites" /></a> Get all Games,Apps and Wallpapers Nokia, Samsung and Sony Erricson!! |
|
|
|
||
|
#2
|
||
|
thats a pretty handy tool that you got there
![]()
__________________
Classic Auto's | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | Your Ad Here | |
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|