Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-25-2004, 12:38 PM   PM User | #1
miggsy007
New Coder

 
Join Date: Oct 2004
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
miggsy007 is an unknown quantity at this point
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
miggsy007 is offline   Reply With Quote
Old 10-25-2004, 12:43 PM   PM User | #2
gsnedders
Senior Coder

 
gsnedders's Avatar
 
Join Date: Jan 2004
Posts: 2,340
Thanks: 1
Thanked 7 Times in 7 Posts
gsnedders will become famous soon enough
That is so wrong, Google will only check low-ttraffic sites weekly...
__________________
Geoffrey Sneddon
gsnedders is offline   Reply With Quote
Old 10-25-2004, 12:44 PM   PM User | #3
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
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
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 10-25-2004, 05:18 PM   PM User | #4
miggsy007
New Coder

 
Join Date: Oct 2004
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
miggsy007 is an unknown quantity at this point
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
miggsy007 is offline   Reply With Quote
Old 10-25-2004, 05:20 PM   PM User | #5
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
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); 
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 10-25-2004, 05:36 PM   PM User | #6
miggsy007
New Coder

 
Join Date: Oct 2004
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
miggsy007 is an unknown quantity at this point
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
miggsy007 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:58 AM.


Advertisement
Log in to turn off these ads.