Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

browser info

Status
Not open for further replies.

RobBroekhuis

Technical User
Joined
Oct 15, 2001
Messages
1,971
Location
US
I'm writing a forum application, and am trying to log which browsers/platforms my users use, so I can make sure everything works properly for them. I have used two approaches for gathering browser information: on login, I run Javascript client-side to populate a hidden form input that gets returned to php. And I also use php's get_browser function on the server side. The former approach has so far been vastly more successful - it always returns something useful, if not always perfectly accurate. The success rate of the get_browser call seems rather small. If I could, I'd prefer to keep this server-side, but for now it looks like client-side gives me better results. What are the pitfalls with get_browser?


Rob
[flowerface]
 
Have you considered evaulating your web server logs? Browser identification is stored in the HTTP requests and log procesing software such as Analog can extract it easily.
 
Yes, I can statistical info from the logs. But I want to be able to link a particular user with the browser he's using, so that I can ask that user specific questions about how my site works for him. Also, I'm simply curious why get_browser seems to fail to return pertinent information a good part of the time.

Rob
[flowerface]
 
Under what circumstances does it fail to return information?

Is it for a particular browser brand and version?

Or does it on one call with a particular browser return information, but not for the next using the same browser?

If it's the former, then your browscap.ini file does not contain information for that browser.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
I'm going to have to look into this a little further. I can't access browscap.ini myself (it's on a host server), so I don't know if it's the most up-to-date version. I'm pretty sure get_browser has failed for some users with common browsers (as if the script just didn't receive the USER_AGENT information at all). It certainly fails for Mozilla Firebird (for which it returns "default browser").
I will continue logging both client-side and server-side results until I understand the limitations of each.
Thanks for your helpful comments!


Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top