(Back) link checker
Please support our PHP advertiser: Free Online Load Test - How many visitors can your web site handle?
This function is usefull for peoples with a link directory where the links are stored inside a (MySQL) database. The PHP script is easy to use to find out if a reciprocal link still exists on the corresponding webpage. It takes care about the trailing slash in urls and can be used with (almost) every url. Inside the function is a check against a regular expression pattern and the result is a simple boolean. Check the example here
<?php function check_back_link($remote_url, $your_link) { $match_pattern = preg_quote(rtrim($your_link, "/"), "/"); $found = false; if ($handle = @fopen($remote_url, "r")) { while (!feof($handle)) { $part = fread($handle, 1024); if (preg_match("/<a(.*)href=[\"']".$match_pattern. "(\/?)[\"'](.*)>(.*)<\/a>/", $part)) { $found = true; break; } } fclose($handle); } return $found; } // example: //if (check_back_link("http://www.all4yourwebsite.com", "http://www.finalwebsites.com")) echo "link exists"; ?>
gezilistesi | Newbie Poster | Oct 16th, 2008
•
•
•
•
this is not working
You have any code for baclink checker code for my web site
http://www.gezilistesi.com
You have any code for baclink checker code for my web site
http://www.gezilistesi.com



