function CheckURI($parurl) { //VGR18032003 // inits $result=TRUE; // try to get URI $filename = "$parurl"; $tobec=TRUE; $fd = @fopen ($filename,'r'); if ($fd) { // si page trouvée while ((!feof ($fd))and($tobec)) { $ligne= fgets($fd, 4096); if (!(strpos($ligne,'[404] Not Found')===false)) $tobec=FALSE; // stop as soon as this is encountered $contents []=$ligne; } // while lecture bloquante fclose ($fd); if ($tobec) { // file entirely read OK (note that we could stop after X first lines, the '404' message is not at the 345th line... // nothing, result is TRUE already // this block is in case you want to log anything like "last correct date where found the URI was OK" } else { // we stopped before the end : 404 found $result=FALSE; } } else { // page not found $result=FALSE; } // if page trouvée ou non return $result; } // CheckURI Boolean Function
for European Experts Exchange and Edaìn Works back to list of test scripts
Last update 1970-01-01 01:00:00
Copyright(©)(c) the respective authors. Licensed under the Creative Commons Attribution Share Alike 3.0 License .
These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!