On May 14, 4:01 am, "George" <@wrote:
Thanks
You could try looking at the user agent string and analysing that to
try and guess the browser, but in all honesty there's no 100% reliable
way to determine what browser the user is using. The user agent
string is sent by the browser but there's nothing preventing the
browser sending one that identifies it as a different browser from
what it actually is.
Why do you need to know what browser the user is using though? The
browser the user has should be irrelevant to what content they get
served. If you're attempting to get around browser rendering issues
(ie IE6 and its brain damaged CSS), then conditional comments in the
HTML is a better approach. Only IE recognises them, other browsers
ignore them, so you can use them to load IE specific stylesheets and
javascript to work around that browser's flaws.
Don't try using user agent analysis to lock certain browsers out of
your site! You're annoying users and driving them away, and those
determined enough and knowledgeable enough to spoof the user agent
string can get around any blocks you might put up any way.