...

View Full Version : Googlebot Alerts



miggsy007
10-25-2004, 12:38 PM
Hi all. I have the followng php in the index file for my website.



<?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

gsnedders
10-25-2004, 12:43 PM
That is so wrong, Google will only check low-ttraffic sites weekly...

Nightfire
10-25-2004, 12:44 PM
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


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

miggsy007
10-25-2004, 05:18 PM
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

Nightfire
10-25-2004, 05:20 PM
if($google_alert) {
mail("miggsy007@hotmail.com", "googlebot alert", $message);
}

On the bit above, delete the if statement, to just produce this



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

miggsy007
10-25-2004, 05:36 PM
You're a hero Nightfire.

Thanks again,

Miggsy007



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum