Gossamer Forum
Quote Reply
Browser Detection
Hi there,

I am trying to apply my own custom GLinks rounded corners Global to the GLinks install. But due to compatibility issues between FF and IE it is not displayed the same in the two browsers. So I went, developed a second script, and now I have one for FF and one for IE ^_^

Now I am trying to find a way to detect whether the user is using FF or IE using Perl. I have searched the net, found possible solutions, but unfortunately, they don't seem to work.

It would be nice to have a global testing for the browser type, but that's just me. If anyone have some advice or help, please help me, if you want to... Smile

Regards,
EZFrag


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Browser Detection In reply to
Hi,

Something LIKE this should work:

Code:
if ($ENV{HTTP_USER_AGENT} =~ /Firefox/) {
# its firefox =)
} else {
# otherwise, should be IE
}

It may not work on other programs such as Mozilla /other browsers (cos although a lot of the browsers use "Mozilla" as a base for their platform - they won't have Firefox in the HTTP_USER_AGENT thing)

Anyway, hope that helps Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [EZFrag] Browser Detection In reply to
GT::CGI has browser detection. $IN->browser_info() returns a hash with is_ie, ie_version, is_mozilla mozilla_version, etc. However, due to a change in Firefox 3 and a regex change, it's a little broken at the moment (doesn't detect firefox correctly).

Though really, you probably should be using IE's conditional comments: http://msdn.microsoft.com/...ibrary/ms537512.aspx

Adrian
Quote Reply
Re: [EZFrag] Browser Detection In reply to
Where do you want those rounded corners? I use the rounded corners on a lot of template I can pass on the shadow css if you need it.


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [EZFrag] Browser Detection In reply to
Thank you for you input. It helped alot Wink


Sacrifice is not about what you lose,
it is about what you gain in the process.