Created
May 9, 2012 15:18
-
-
Save zQueal/2645404 to your computer and use it in GitHub Desktop.
PHP Website Online Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // (C) 2012 Zach Queal - Usage: $status = ServerStatus('domain.com',80); | |
| // Icons (C) 2012 @designkindle http://www.designkindle.com/ | |
| function siteCheck($site, $port){ | |
| $check = @fsockopen($site, $port, $errno, $errstr, 30); | |
| if($check){ | |
| echo "<img alt='Online!' src='http://i.imgur.com.nyud.net/QXgTw.png' />"; | |
| } else { | |
| echo "<img alt='Offline!' src='http://i.imgur.com.nyud.net/9PHoh.png' />"; | |
| } | |
| } | |
| return siteCheck('google.com',80); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment