Link testing?

External links that die (aka linkrot) can sometimes be a problem. Can
anyone see a way to use PHP to test links on the fly as a page is
requested so that it can include a link or leave it out as necessary?

I imagine this could be somewhat convoluted and might possibly impact
on performance, if it can be done sensibly at all. Does anyone have
any thoughts on the matter?

k


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It would be extremely slow, but you could test for errors like this:

//start an output buffer to isolate the junk
ob_start();
foreach($links as $k=>$link){
    if (!include($link)){
        $links[$k] = 'error';
    }
}
ob_end_clean();

This is the sort of thing you would want to run once in a great while, because each attempt to include a remote file would each need time to time out.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options