Ok so I am making a script for like downloads from other sites, and I want to be able to show if a download is online or not, liek fi i have www.site.com/file.exe i wanna know if the site is online or even better if the file is there also
i found this script by searching, but im not sure if it works for domains...
function serverStatus() {
if ($fp = @fsockopen("192.168.2.1", 80, $errno, $err,2)) {
return true;
} else {
return false;
}
}
and this is a custom function, which i never use custom functions, i dunno why, jus havnt dont that much coding that requires functions, how do i use functions like that, that i have made, in my scripting? would i do like, if ( serverStatus() == 1 ) light = green
else light = red
thnx =]