| | #1 |
| SERPDEMON Join Date: 2011
Posts: 226
Thanks: 79
Thanked 18 Times in 15 Posts
|
Looking to have a pinging device like www.pingdevice.com. Pm me if interested. Send any portfolio, recomendations, cost for service, etc...
|
| |
| | #2 |
| Professional Webdeveloper Join Date: 2011
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
| Code: <?php
/* our simple php ping function */
function ping() {
exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg()), , );
return === 0;
}
/* check if the host is up can also be an ip address */
= 'www.example.com';
= ping();
/* optionally display either a red or green image to signify the server status */
echo '<img src="'.( ? 'on' : 'off').'.jpg" alt="'.( ? 'up' : 'down').'" />';
?> |
| |
|
| Bookmarks |
| Tags |
| programmer |
| |