redarrow Posted August 30, 2006 Share Posted August 30, 2006 Hi there can you point me in the right syntex codes for me to be able to cheek if a link exist on someones website cheers. Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 30, 2006 Author Share Posted August 30, 2006 solved[code]<?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"; ?> [/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.