Home >Backend Development >PHP Tutorial >PHP method to obtain Google robot access footprints, google robot_PHP tutorial
This article describes the method of php’s getting Google robot’s access footprint. Share it with everyone for your reference. The details are as follows:
<?php $email = "test@test.com"; if(eregi("googlebot",$HTTP_USER_AGENT)) { if ($QUERY_STRING != "") { $url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING; } else { $url = "http://".$SERVER_NAME.$PHP_SELF; } $date = date("F j, Y, g:i a"); mail($email,"[Googlebot] $url","$date - Google crawled $url"); } ?>
I hope this article will be helpful to everyone’s PHP programming design.