FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Customizing my site for different browsers





Fenroy
I was just wondering...is there a way to customize my page based on the browser it's being accessed from using PHP? I've already looked into the get_browser() method and got the following warning from my site:

Warning: get_browser(): browscap ini directive not set. in /home/fenroy/domains/livemyth.frih.net/public_html/test.php on line 5

It would be really nice if I could do this because IE stabs my page through the throat. For an appropriate example, look at this page in both Firefox and IE. You should notice issues with both the outermost border and the navigation area.
Marston
http://www.spoono.com/php/tutorials/tutorial.php?id=13
Fenroy
Marston, you are officially my hero. I haven't tested the code yet, and I have yet to develop a stylesheet for IE, but your link has put me on the right track. Thanks again.
Marston
Smile
Fenroy
Well, copy-pasting the code from that tutorial doesn't seem to work. In fact, I can't get it to work at all. It keeps returning false for the first two if statements and immediately uses the else stylesheet regardless of what browser I'm testing in. Any idea why this might be?

EDIT:
I figured out why it wasn't working. All I had to change was $HTTP_USER_AGENT to $_SERVER['HTTP_USER_AGENT'] and it worked fine.
Related topics
my site in different browsers - testers please?
Site different (corrupted) in other browsers
web design and site optimisation tips
Flash
HTML to Dynamic!?
Firefox Problem!
whats happening to fire fox?..
Help!!! My DirectAdmin isn't working!!!
I Need Help For Intro Page On My Site
Tips I have had success with...
Beginner's Question
Need critique before site redesign
redirect...???
File Upload from webpage failing
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.