Jump to content

Back Linl Checker


Bartman

Recommended Posts

<?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";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/260262-back-linl-checker/#findComment-1334612
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.