Hi all,
Im pretty new to PHP so keen to make sure that I am on the right track and whether or not I could make my code better.
Some of you may also find this useful 🙂
The purpose of the following code is to be used as an include file to send the webmaster (me in this case) an email when Google has been detected crawling the site. Very useful for those who know about SEO.
Anyway - let me know if I could do things better.
<?php
$string = strpos($HTTP_USER_AGENT, "google");
if ($string === false)
exit();
else
{
mail("angus@webdork.com", "Google is crawling", "Google has crawled phphacks.com");
}
?>