PDA

View Full Version : how do I find out the users browser


2bz2p
10-16-2008, 11:58 AM
Hi,

The question is in the subject, how do I find out a users browser. Hopefully a method in which they cannot choose to say no.

Thanks
2b

davidj
10-16-2008, 01:22 PM
$_server['http_user_agent'];

2bz2p
10-16-2008, 02:02 PM
I the user blocks the detection of the browser will this still give it to me?

I think I have to write to .css files for each browser which sucks, because I cant figure out how to get everything lined up right other wise. Especially since it looks the best with png files and ie 6 doesnt support em and ie 7 has to be different.

thanks
2b

davidj
10-16-2008, 02:56 PM
not sure really

this is the only way i know how in PHP

m1a2x3x7
10-16-2008, 05:23 PM
you can use if statements in your css

<!--[if IE 6]>
Special instructions for IE 6 here
<![endif]-->

<!--[if IE 7]>
Special instructions for IE 7 here
<![endif]-->

http://labs.unitinteractive.com/unitpngfix.php
Great for ie6 png fix.

davidj
10-16-2008, 05:36 PM
oh

sorry mate

i didn't realise that was your goal

i misread your post.

2bz2p
10-16-2008, 06:03 PM
oh

sorry mate

i didn't realise that was your goal

i misread your post.

You answered it, I figured If I can find out the browser I can assign the css file via php.

The if is what I posted in the html/css board. Then after many hours of banging my head against the wall and getting nowhere with the ifs, I thought about usign multiple css pages.

By the way I officially hate css :x

(could be because I do not get it)

thanks
2b

davidj
10-16-2008, 06:07 PM
aye

i can see the benefits of CSS and i get the headaches as well

digitaldesperad
10-20-2008, 06:13 PM
go here:
http://webscripts.softpedia.com/script/Snippets/get-browser-24223.html
and download...i hope helped you :confused: