newbie stats-spider

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
dal_oscar
Forum Newbie
Posts: 21
Joined: Fri Apr 07, 2006 6:00 am
Location: UK

newbie stats-spider

Post by dal_oscar »

Hi,

I am using 'crawler' in get_browser to check if a visitor is a spider/crawler

$isspider=0;
$ua = get_browser(null,TRUE);
if ($ua->crawler == TRUE)
$isspider=1;


And then in my code, I check the value of $isspider to dump the data accordingly. The problem is, that $ua[crawler] always seems to be null. I am also storing the HTTP_USER_AGENT values, and saw using those that an MSNbot just visited my website. But $ua['crawler'] fails to register this (it is always null).

Any ideas?

Thanks.

P.S.- I also posted a related query last friday viewtopic.php?t=46766 and viewtopic.php?t=46937, and have got to this stage now, but am still running into trouble
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Is it

Code: Select all

$ua['crawler'];
or

Code: Select all

$ua->crawler;
This will make a difference.

Cheers,
BDKR
dal_oscar
Forum Newbie
Posts: 21
Joined: Fri Apr 07, 2006 6:00 am
Location: UK

Post by dal_oscar »

currently it is

$ua->crawler

but which one should it be? is that all to it?
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

dal_oscar wrote:currently it is

$ua->crawler

but which one should it be? is that all to it?
It should be $ua->crawler. Dumping $ua['crawler'] won't gain you anything as it won't work.

Are you aware of the difference here?
dal_oscar
Forum Newbie
Posts: 21
Joined: Fri Apr 07, 2006 6:00 am
Location: UK

Post by dal_oscar »

no....what's the difference?
thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Thread locked. This is the exact same "problem" in your last thread. Continue to use it.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

I feel used. :(
Locked