Bartman Posted April 3, 2012 Share Posted April 3, 2012 Can someone please point me in the right direction on finding a script that will check for a back link before allowing the submission of a form? Maybe it is onclick or something to that nature. Thanks, I have been searching for days Quote Link to comment https://forums.phpfreaks.com/topic/260262-back-linl-checker/ Share on other sites More sharing options...
JonnoTheDev Posted April 5, 2012 Share Posted April 5, 2012 <?php function check_backlink($url, $tofind) { // prevent using the same url to return true if(stristr($tofind, $url)) { return false; } ob_start(); if(!@readfile($url)) { return false; } $body = ob_get_contents(); ob_end_clean(); if(stristr(htmlentities($body),$tofind)) { return true; } return false; } // usage $to_check = 'http://www.thirdpartywebsite.com'; $looking_for = 'http://www.mywebsite.com'; if(!check_backlink($to_check, $looking_for)) { echo "no backlink found"; } else { echo "thanks"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/260262-back-linl-checker/#findComment-1334612 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.