Jump to content

Most efficient browser determination method


freelance84

Recommended Posts

http://www.phpfreaks.com/forums/index.php/topic,308549.0.html

 

The above link is a problem relating to CSS. The way route i've choosen thanks to haku is to determine the users browser then let php give one css or another.

 

What is the best way to determine the users browser. At the moment i can only find a problem with css fixed in ie6 and below. Therefore i only really need to find if the user is running on ie6.

 

I've come accross the http://php.net/manual/en/function.get-browser.php but requires http://browsers.garykeith.com/downloads.asp.

 

Is there a simpler way?

Link to comment
Share on other sites

you should never need to do this.. :) unless you're delivering browser dependant plugins or operating system specific..

 

the popup can work solely on position: absolute; across every browser..

 

you just need to declare the popup in html source OUTSIDE of your content div.. for example..

 

<body>
  <div>LALALALA</div>
  <div id="popup">
  </div>
</body>

 

then code it  the wya you normally would :)

 

however, I also suggest you make #popup width: 100%; and inside have a popupContainer.. that is X wide or whatever.. position: relative; margin: auto;

 

that will position it in the center aslong as #popup has text-align: center; specified :)

 

good luck

Link to comment
Share on other sites

And besides, I don't think haku was referring to you using PHP to determine the users browser when referring to conditional statements, but Conditional Comments.

 

If you really need to load a separate stylesheet for IE:

<!--[if IE 6]>
Load another stylesheet for IE
<![endif]-->

 

More information can be found here.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.