PDA

View Full Version : Url Check



sehuj
February 24th, 2003, 14:31
Hello,
I'm running site with links to other sites. Some links don't work but I don't know which. Do you know any script which is able to detect broken links?

Thank you

dsgdevil
February 24th, 2003, 14:58
i dont think so.why dont you go through it manually?

ducktape
February 24th, 2003, 23:35
you could use php to try to check if a link is dead or not

spec
February 25th, 2003, 02:33
PHP can do it using sockets.

kabatak
February 25th, 2003, 03:29
This may not be th best way, but it should work


<?
$fp = @fopen("http://www.yahoo.com/","r");
if ($fp)
{ print"The URL exist"; }
else
{ print"The URL does not exist"; }
?>

sehuj
February 25th, 2003, 14:04
Originally posted by dsgdevil
i dont think so.why dont you go through it manually?

Over 500 links.

sehuj
February 25th, 2003, 14:07
Originally posted by spec
PHP can do it using sockets.

Yes it can. Have you got this code? Or can you write it?

spec
February 25th, 2003, 19:02
I can. depending on what you want and what motivates me.

Cagez
February 25th, 2003, 19:19
<?
$site = "http://sitetocheck";
if(!(fsockopen($site, 80)))
{
die("Doesn't exist");
}
?>

http://www.php.net/manual/en/function.fsockopen.php

:)

sehuj
February 26th, 2003, 14:49
Originally posted by spec
I can. depending on what you want and what motivates me.

So, I need easy script which only check if url exist. Not only host.

Cagez
February 26th, 2003, 15:17
fsockopen function in PHP does what you need, look at my example. It should be sufficient.

sehuj
February 27th, 2003, 15:31
OK