Forum Moderators: coopster

Message Too Old, No Replies

Search Engine Bot Check

         

trigoon

9:28 pm on Jun 16, 2008 (gmt 0)

10+ Year Member



Hello

Currently I have a script made that will limit how many pictures a person can view in a gallery script I've made. However for now its very limited in that it can only tell if the user is a guest or a logged in user [using smf's SSI.php].

Is there any script or code I can use to tell if the user is a search engine bot (from any search engine)?

venelin13

4:17 am on Jun 17, 2008 (gmt 0)

10+ Year Member



Well, you will need to check the $_SERVER['HTTP_USER_AGENT'] value against a list of search bot names, for example:


if(eregi("googlebot", $_SERVER['HTTP_USER_AGENT']) ¦¦ eregi("slurp", $_SERVER['HTTP_USER_AGENT'])){
//this is googlebot or yahoo bot
}