Forum Moderators: coopster
To avoid having too many dead links to sites I wrote a dirty script to loop through the URLs in the DB but it doesn't work all the time and was wondering if there's a better and more precise way of checking.
Here's what I currently do:
while($row = mysql_fetch_assoc($result))
{
$fp = @fopen($row["url"],"r");
if ($fp) {
echo $row["title"]." working<br>";
} else {
echo $row["title"]." <strong>not working</strong><br>";
}
$i++;
}
Also, having an inbuilt script would be better, as what I planned to do is display all the sites which the script say are dead. Display the URL and name which are clickable to be able to review whether to delete them or change the status to under review which would keep the URL in our links database, but take them off the front end.