Code.GeekInterview.com
  I am new, Sign me up!
 
Code Samples PHP
 

Get an email when google visits your Blog


Code ResourceAuthor: jayantg  

Difficulty Level:

Published: 5th Nov 2006   Read: 1474 times  

Filed in: PHP
Add Comment


 


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 Comment


Members Please Login

Name:  Email: (Optional. Used for Notification)

Title:
 
Comment:
Validation Code: <=>  (Enter this code in text box)





Comments

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

Popular Coders

# Coder NameHits
1. chowsys7299
2. jijo chacko4019
3. Lokesh M2284
4. jayantg1475

Active Coders

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

Refined Tags

 

Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact  

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape