Zend - The PHP Company




Link Checkers

Add Code


valid link!  

Type: code fragment
Added by: idban
Entered: 08/07/2000
Last modified: 07/12/2001
Rating: *** (12 votes)
Views: 29975
This is a simple PHP code that lets you see if a link is valid before
displaying it on your Web page. It is useful since you can have live links,
but your site can become slow as the script checks the link before
displaying the link. Just imagine if you got 100 links to check.


<? 
//idban secandri July 2000 please distribute is as GPL
//
//greeting as usual to desy, nadya, my friend at satunet group!

$phpnet fsockopen("www.php.net"80, &$errno, &$errstr30); 
if(!
$phpnet) { 
//change with your custom messages
echo "<b>php.net <font color="red">down!!</font></b>n"; } 
else { 
echo(
"<a href="http://www.php.net">php.net</a>"); 
}

?> 


Usage Example


See the example


Rate This Script





Search



This Category All Categories