If someone have extra time to check this out, please help me. I'm totally blind when it comes to programming and thought there is probably many helpful experts.
This is part of php script that checks reciprocal links from sites in database. However, this will automatically delete link if link back is not found.
So I'm trying to get this working so that it only shows link wasn't there. Without deletion.
This should be the part of code to edit.
echo "<p>Checking link N. <b>$i</b>...<br>\n";
echo "Link URL: $url<br>\n";
if ($recurl == "http://nolink")
{
echo "<b>No reciprocal link required!</b><br><br>\n";
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -</p>\n";
$i++;
$found=0;
flush();
continue;
}
else
{
echo "Reciprocal URL: $recurl<br>\n";
}
echo "Opening and reading reciprocal URL ";
$remote = @fopen($recurl, "r") or $remote = "NO";
if ($remote == "NO") {echo "<br>\nERROR: CAN'T OPEN URL, PLEASE TRY LATER!<br><br>\n\n";}
else
{
while ($html = fread($remote,1024)) {
if (preg_match("/$site_url2/i",$html)) {$found=1; break;}
echo ".";
}
if ($found==1) {echo "<br>\nA link to $settings[site_url] was found!<br><br>\n\n";}
else {
echo "<br>\nLINK NOT FOUND!<br><br>\n\nRemoving link ...<br>";
unset($lines[$i-1]);
$rewrite=1;
}
}
$i++;
echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - -</p>\n";
$found=0;
flush();
}
if ($rewrite == 1)
{
$lines = array_values($lines);
$fp = fopen($settings['linkfile'],"wb") or die("Can't write to link file! Please Change the file permissions (CHMOD to 666 on UNIX machines!)");
foreach ($lines as $thisline) {
$thisline .= $settings['newline'];
fputs($fp,$thisline);
}
fclose($fp);
}
echo <<<EOC
<p> </p>
<p><b>DONE!</b></p>