php - Toggle links for crawler and guest visitors -
i need display 2 different links crawler , guest. example:
crawler see normal link - <a href="example.com">example.com</a>
guest see link - <a href="other.com/register">register see link</a>
// check user agent of current 'visitor' if($detect->iscrawler()) { // true if crawler user agent detected }else{ // false }
for part, can determine if site being crawled looking @ 'user-agent' header:
function iswebcrawler() { $iscrawler = false; $useragent = $_server['http_user_agent']; if(strlen(strstr($useragent, "google")) <= 0 ) { $iscrawler = true; } return $iscrawler; }
here listing of user agent strings of major bots: list of web crawler user agents
Comments
Post a Comment