Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Oct 2004
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Googlebot Alerts

    Hi all. I have the followng php in the index file for my website.

    Code:
    <?php
    
    if(eregi("googlebot",$_SERVER['HTTP_USER_AGENT'])) {
      $s = "";
      foreach($_SERVER as $item => $value) {
        $s .= "\n$item : $value";
      }
      $sdate = date("Y-m-d h:i:s");
      $message = <<<MESSAGE
    Visit date:$sdate
    Information:
    =================================
    $s
    =================================
    MESSAGE;
      if($google_alert) {
        mail("miggsy007@hotmail.com", "googlebot alert", $message);
      }
    }
    ?>
    It's supposed to alert me every time Googlebot checks my site. But it's been on for a few hours now and nothing's come through. I've heard that Googlebot should check even low traffic sites like mine at least a few times an hour.

    Have I made a mistake with the PHP? Or is my site so unpopular that even Googlebot doesn't want to look at it? That's probably the most likely answer to be honest, but I thought I'd ask you kind folks to check for me. The site is the one in my signature if you want to see the code in situ.

    Cheers,

    Miggsy007
    Please visit My Site - Especially if you play CS or DoW.

    'Don't worry men, they couldn't hit a bull at this distance.' - Last words of General Patton

  • #2
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    That is so wrong, Google will only check low-ttraffic sites weekly...

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Have to give it more than a few hours. Google doesn't check everyday, or set hours, or set number of times an hour. Give it a week or so.

    Plus this bit
    PHP Code:
     if($google_alert) { 
    Don't know what it's referring to, there is no google_alert variable in the code you posted, so you wouldn't get an email. Delete the if statement

  • #4
    New Coder
    Join Date
    Oct 2004
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
     if($google_alert) { 
    Delete all this? Even the {?

    Thanks for helping me again Nightfire, you are my knight in shining armour mate!

    Thanks for the point about Googlebot too 404, I seem to have been misinformed.

    Cheers,

    Miggsy007
    Please visit My Site - Especially if you play CS or DoW.

    'Don't worry men, they couldn't hit a bull at this distance.' - Last words of General Patton

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    PHP Code:
    if($google_alert) {
        
    mail("miggsy007@hotmail.com""googlebot alert"$message);
      } 
    On the bit above, delete the if statement, to just produce this
    PHP Code:

        mail
    ("miggsy007@hotmail.com""googlebot alert"$message); 

  • #6
    New Coder
    Join Date
    Oct 2004
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're a hero Nightfire.

    Thanks again,

    Miggsy007
    Please visit My Site - Especially if you play CS or DoW.

    'Don't worry men, they couldn't hit a bull at this distance.' - Last words of General Patton


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •