I am working on a script which show the server status of a site ...
This is what i used :-
<?php
$ip="{$_GET['ip']}";
$port="{$_GET['port']}";
header('Content-type: image/png');
if(!$sock=@fsockopen($ip,"$port", $num, $error, 5)) {
readfile('image/offline.png');
} else {...