Can someone take a look at this script. Sometimes it work but most of the time it doesnt. I know the links are there but its echoing not found for some reason
[php]
<?php mysql_select_db($database_connection, $connection); $query_links = "SELECT * FROM links WHERE id = '$id'"; $links = mysql_query($query_links, $connection) or die(mysql_error()); $row_links = mysql_fetch_assoc($links); $totalRows_links = mysql_num_rows($links); $siteURL = $row_links['site_url'];; $recip_link = $row_links['recip_url']; function check_back_link($recip_link, $siteURL) { $match_pattern = preg_quote(rtrim($siteURL, "/"), "/"); $found = false; if ($handle = @fopen($recip_link, "r")) { while (!feof($handle)) { $part = fread($handle, 1024); if (preg_match("/(.*)/", $part)) { $found = true; break; } } fclose($handle); } return $found; } if (check_back_link($recip_link, $siteURL)) { echo "Link Found"; } else { echo "Link Not Found"; } ?>[/php]