Forum Moderators: coopster

Message Too Old, No Replies

How to detect Mozilla or IE with PHP?

         

toplisek

2:37 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is there possibility to detect Mozilla or IE with PHP and than changed height in table for 1-2px?

How can be done and determine the browser using JavaScript via the navigator.userAgent object?

Need help

thank you

[edited by: toplisek at 2:58 pm (utc) on Aug. 5, 2008]

mrscruff

2:40 pm on Aug 5, 2008 (gmt 0)

10+ Year Member



Can use:

$_SERVER['HTTP_USER_AGENT']

and

get_browser() [uk3.php.net]

toplisek

3:08 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



how to pull name of browser and execute change in height in table tag?

rainborick

4:16 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Generally speaking, its best to avoid changes based on browser types. You should find that if you use a complete <!DOCTYPE> statement on your pages so that they are rendered in Standards Compliance Mode, all browsers behave very similarly. At least they're trying to behave when you do this, and I'll admit that heights are sometimes a problem area. But if you work in Standards Compliance Mode, you'll greatly reduce your overall maintenance problems. Search on "Standards Compliance Mode doctype" and you'll find some good advice. It's worth the effort, honest.

toplisek

4:35 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is some solution to pull variable data from this PHP
line?

SuzyUK

4:49 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP produces HTML, using HTML means you can take advantage of the fact that Microsoft offer their own conditional comments [google.com] which detects not only IE but also the version, perhaps that might help?

or is it Moz you need to target?

toplisek

5:02 pm on Aug 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have problem that in IE it works height in table but in Mozilla not.
So, I would like to leave as it is in IE and other browsers but in Mozilla should change height. Version is not important.

paulmadillo

1:14 pm on Aug 6, 2008 (gmt 0)

10+ Year Member



This sounds like more of a CSS issue.

Have a search for CSS Hacks.