Forum Moderators: coopster

Message Too Old, No Replies

Is there a resource detailing HTTP_USER_AGENTc ontent?

         

MTKilpatrick

11:58 am on Jul 25, 2003 (gmt 0)

10+ Year Member



I was half thinking about using PHP to do some browser sniffing in order to filter out inappropriate parts of my CSS external files. I've just realised that you can write a CSS file using PHP, if you set the content-type, use fpassthru(file) to include other CSS files, and things like that.

I would like to find a definitive list of the possible contents of the $_SERVER['HTTP_USER_AGENT'] variable, so that I know I can correctly preg_match it for early browser types.

Is there a list anywhere, so that I can see clearly, for example, what the result is of someone using IE5 on a Mac, Netscape 4.x on a PC, and other combinations?

Michael

vincevincevince

6:20 pm on Jul 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure about definative lists - but just look in your server logs and see what's been coming ;-)

Generally sniff for Mozilla -> mozilla client, then if MSIE then change to IE client...

Remember that people often change their UA for various reasons (so they aren't told sites don't work with XYZ browser when they do, so they can protect their privacy, so they can enhance security, because they are paranoid...)