Code.GeekInterview.com
 
Code Samples PHP
 

Get an email when google visits your Blog


Code ResourceAuthor: jayantg  

Difficulty Level:

Published: 5th Nov 2006   Read: 3231 times  

Filed in: PHP
Add Comment


 

 

Sponsored Links


 

 

When googlebot comes to pages that contains this code, you get an e-mail sent to the email address you specify. Insert the PHP code below in all pages where you want to track whether google is visiting the page or not. If you have include a file like header.php, footer.php,.. etc. everywhere then you can simply place this code in any of those files to track all those pages. MT users can place it in their template and all their pages will be tracked.

 


Sample Code
  1. <?php
  2. //Change the following to your email address
  3. $email = "myemail@something.com";
  4. if(eregi("googlebot",$_SERVER['HTTP_USER_AGENT']))
  5. {
  6. mail($email, "Googlebot detected",
  7. "Google has crawled : ".$_SERVER['REQUEST_URI']);
  8. }
  9. ?>
Copyright GeekInterview.com


Next: Custom Filtering Unwanted Words


 

Latest Code Samples

 

Popular Code Samples

 

Related Code Samples

 

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    



Comments

Simple and Good One
Comment posted by: Jim on 2006-11-05T16:28:58

Popular Coders

# Coder NameHits
1. chowsys21591
2. jijo chacko9599
3. Lokesh M8354
4. jayantg3232

Active Coders

# Coder NameCodes
1. chowsys6
2. Lokesh M2
3. jayantg1
4. jijo chacko1

Refined Tags