PHP cloaking script
Sometimes you need to show another text to crawlers ![]()
This script check serfer User-Agent and if this UA is listed in variable $bot_lst - so, it’s bot…
- // List of bots:
- $bot_lst=array(
- 'google',
- 'msn',
- 'yahoo'
- );
- $is_bot=0;
- for($i=0; $i<sizeof($bot_lst); $i++)
- if(strstr(strtolower($HTTP_SERVER_VARS['HTTP_USER_AGENT']), strtolower($bot_lst[$i])))
- $is_bot=1;
- if($is_bot) echo 'Hello bot :)';
- else echo 'Hi user :]';
- echo '<p>Your UserAgent: '.$HTTP_SERVER_VARS['HTTP_USER_AGENT'].'</p>';
Tags: SEO, PHP, cloaking, php, scripts, search engines, server