Page 1 of 1

The IE or FF detector

Posted: Tue Oct 13, 2009 5:06 pm
by egturnkey
Hello Friends,

Problem of today ( we seek for php help ) as following ,

we know all that PNG images not shown well on IE6 and some "css'ers" given us a solution --> fine 1

but if that PNG is within css hover code no way to be working correctly i.e i've tried millions of ways all failed


the only way i've got is to use something called "filter"

but that filter is not working for FF and only working for IE

so i wonder if


- we are able to set a php code

if ( it IE) then ( run style_ie.css ) if not ( IE ) then ( run style_ff.css )


hence is there any code to detect it and can be re-write as if X then Y and if not then Z


hope you got wt i mean ....

thanks in advance

Re: The IE or FF detector

Posted: Tue Oct 13, 2009 8:34 pm
by Weiry
Im not really sure of a shorthand way of doing this, but i checked through the php function list and found
get_browser()

This is a copy/paste example from the website. The only problem is that it requires the list of browsers in the array to be up to date if any new browsers are released.
Detect Browser Class

Re: The IE or FF detector

Posted: Wed Oct 14, 2009 11:00 am
by pickle
The filter: declaration is ignored by Firefox. You should be able to put it in your CSS & Firefox should work fine.

Re: The IE or FF detector

Posted: Wed Oct 14, 2009 11:04 pm
by Eric!
In PHP you can also check $_SERVER['HTTP_USER_AGENT'] for the information provided by the browser...which is sort of similar to get_browser();