Helpful Information
 
 
Category: CGI
CGI->PHP | Very usefull script

Hello all!
Just found a CGI script that checks any given server and idf it's alive, it returns live.gif (green.gif etc). If not - dead.gif (red.gif).
Very useful :)

The problem is : I can't use CGI on my host and my hoster wont enable it. Could anyone please convert it to PHP?

Any help appreciatted.

hmm.. 7 downloads and no responce at all? :(

18 downloads and still nothing? :(

<?php
if (!$url) {echo "No URL";exit;}

$fp = @fopen("$url","r");
if ($fp)
{
echo "The address valid!";
}
else
{
echo "The address invalid";
}
?>

is the code very basically doing the same thing.. Save it to a file (eg.online.php) and upload it to your server. Then call your file like

url/online.php?url=http://www.domain.com/filetocheck.html

it will return "address is valid" message if the url(page) exits.

Of course you can enhance the code if you want, that is just the algorithm in PHP.

thanx, I'll try it out ;)