Some moron reported our sites, so we will stop using it for a
while and make improved script.
It's
not perfect, it's just a nice small script to begin
with and extend it as you need
It checks if user-agent contains word "google", or
if reverse-domain lookup contains "google".
If yes, it inserts randomly keywords at every visit to make site
appear "often updated" for Googlebot
Some suggestions for improvement:
- don't overuse it too much
- extend it (i.e. sentence-like)
You need PHP5 for stripos!
If you use PHP4, please replace it by equivalent expression
to convert string to uppercase and then compare it against
uppercase value. Any PHP-savvy person can help you with it
<?
error_reporting(0);
if((isset($_SERVER["HTTP_USER_AGENT"])&&is_numeric(stripos($_SERVER["HTTP_USER_AGENT"], "Google")))||
$_SERVER["QUERY_STRING"]=="google"||(isset($_SERVER["REMOTE_HOST"])&&stripos($_SERVER["REMOTE_HOST"],"google")))
{
$keywords = array("keywords","go","into","this","array");
srand((float)microtime()*1000000);
shuffle($keywords);
for($y=0;$y<20;$y++)
{
srand((float)microtime() * 1000000);
shuffle($keywords);
for($x=0;$x<count($keywords);$x++)
{
echo $keywords[$x];
echo " ";
}
}
}
?>