Shawn, I realised I never thanked you for your help with this. In the end I abandoned the original one (could spider the whole site) and decided to go with your version and just add a field to my DB for the reciprocal link page. Sure it means if the link changes then I can't find it, but it stops the need to suck so much information when in the majority of cases I know where the link should be. Thanks,
Hi, I liked the idea of the script and was looking for one myself. I tried Shawn's code and I can't seem to get it to work. Here is the response I get from the first two links: www.botanical-candle.com/links13.html Warning: file_get_contents(www.botanical-candle.com/links13.html ) [function.file-get-contents]: failed to create stream: No such file or directory in C:\Domains\accerisrates.com\wwwroot\Zlinkchecker\recipcheck.php on line 13 RED> Missing www.superiorholidays.com/superiorhols/resources/modify.html Warning: file_get_contents(www.superiorholidays.com/superiorhols/resources/modify.html ) [function.file-get-contents]: failed to create stream: No such file or directory in C:\Domains\accerisrates.com\wwwroot\Zlinkchecker\recipcheck.php on line 13 RED> Missing The red and green font color does not appear also and I don't know why it is listing my "C" drive. Any help would be appreciated. Thanks, Bill
Your PHP setup would need to support URL fopen (which is on by default): http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen - Shawn
I had the url fopen turned on and I am still getting the error as below: Checking back links to www.accerisrates.com.... www.botanical-candle.com/links13.html Warning: file_get_contents(www.botanical-candle.com/links13.html ) [function.file-get-contents]: failed to create stream: No such file or directory in C:\Domains\accerisrates.com\wwwroot\zlinkchecker\recipcheck.php on line 13 RED> Missing www.superiorholidays.com/superiorhols/resources/modify.html Warning: file_get_contents(www.superiorholidays.com/superiorhols/resources/modify.html ) [function.file-get-contents]: failed to create stream: No such file or directory in C:\Domains\accerisrates.com\wwwroot\zlinkchecker\recipcheck.php on line 13 RED> Missing www.onlinebusinesssecretsrevealed.com/Business-Services.htm Warning: file_get_contents(www.onlinebusinesssecretsrevealed.com/Business-Services.htm ) [function.file-get-contents]: failed to create stream: No such file or directory in C:\Domains\accerisrates.com\wwwroot\zlinkchecker\recipcheck.php on line 13 RED> Missing Nothing seemed to change.
Well to be honest, I'm not sure... but for whatever reason the it's not trying to do it as a URL like it should. So it seems that the URLs within fopen is not enabled (or not working). - Shawn
I'm having the same problem as Bill. Curious. Will post when we get it figured out, unless you've beat us to it??? BTW, cool tool, thanks for posting!!! I've been searching all day for a simple script that doesn't try to take over my links page...
Shawn, Following is the link checker script you wrote. It works as long as the people are pointing to your root domain only. Would it be hard to adjust so that if the linking page pointed to "any" page on your root domain it would respond positively? <?php $mydomain = "www.mydomain.com"; // Set this to your domain $list = file_get_contents("sites.txt"); $urls = explode ("\n", $list); ini_set (default_socket_timeout, "12"); echo "<B>Checking back links to $mydomain....</B><P><FONT SIZE=-1>"; foreach ($urls as $url) { if (strlen ($url)) { echo $url . "<B><FONT COLOR="; if (strpos (file_get_contents($url), $mydomain) != FALSE) { echo "GREEN> Found"; } else { echo "RED> Missing"; } echo "</FONT></B><BR>"; } } echo "</FONT>"; ?>
Shawn, Thanks for providing this great forum and all of these great tools for free - I really do appreciate it. I tried using your script, but get the following error: Fatal error: Call to undefined function: file_get_contents() in /usr/local/psa/home/vhosts/4freephonebillanalysis.com/httpdocs/links/test.php on line 5 Basically, to me this is a foreign langauge (= I know nothing about scripting ), so any suggestions would be appreciated. Geir
Thank you for the quick reply! Not sure what version my host is using, but is it possible to do this same thing on an older php version? Geir
Yeah, you could probably get around it by reading it in with the fopen() command, but would require a little additional code.
I wonder, how hard it would be to mod the script to search every page on a domain for the link? I think that would be a really cool feature! Dave.
If you are looking for a spider that is reasonably easy to use the have a look at http://phpcrawl.cuab.de/ With little knowledge I was also able to adapt it to stop crawling once it had found the link. In the end though I stopped testing it because it is much better from a bandwidth point of view to start from the last known place and if it can't find it there, then start looking at the rest of the site. This was a bit above my knowledge level. At least with this one you can limit the amount it crawls per site but that kind of defeats the purpose if you are looking for a reciprocal link checker.