Hmm, just thinking out loud;
I could check each file with something like this:
<?
//Show debug information on screen (for testing purposes)
$DEBUG = 0;
//Function to check for a file on another http server
function checkfile($servername, $filelocation, $portnumber = 80, $timeout = 30)
{
$fp = fsockopen ($servername, $portnumber, &$errno, &$errstr, $timeout);
if (!$fp)
return -1; //Function failed;
else
{
fputs ($fp, "HEAD http://".$servername.$filelocation." HTTP/1.0\n\n");//\nHOST: ".$servername."\n\n");
while (!feof($fp))
$string .= fgets ($fp,128);
fclose ($fp);
if($DEBUG)
echo $string.'<hr>';
if (stristr($string, "200 OK"))
return 1;
else
return 0;
}
}
//Example code.
$server = 'oglchallenge.otri.net';
$file = '/robots.txt';
switch(checkfile($server,$file))
{
case 1: echo 'File Exists.';break;
case 0: echo 'File does not exist.';break;
case -1: echo 'Function Failed.';break;
}
?>
But isn't there a more easy way? :-/