Hey guys!
I got a list of 300 urls which I want to check for a reciprocal link back to
my site. I use this:
function testing_recip($url, $recip) {
@$text = implode("", file($url));
while (eregi("[:space:]*(href)[:space:]*=[:space:]*([^ >]+)", $text,
$regs)) {
$regs[2] = ereg_replace("\"", "", $regs[2]);
$regs[2] = ereg_replace("'", "", $regs[2]);
$regs[2] = preg_replace("/(\s.+)/" , "" , $regs[2]);
if(eregi($recip,$regs[2])){
return true;
}
$text = substr($text, strpos($text, $regs[1]) + strlen($regs[1]));
}
return false;
}
$all_urls = mysql_query("select * from `allurls`");
while($line=mysql_fetch_object($all_urls)){
if(testing_recip($line->url, $mysiteurl)){
echo "Link Found";
}else{
echo "Link Not Found";
}
flush();
ob_flush();
usleep(5000);
}
Whats wrong?
--
Yang