Jump to content

Help creating a style switcher script (I want to switch style sheets...)


Daquan

Recommended Posts

Hello, my name is Daquan Wright.

 

I've been working with xhtml and css for a few years. About a year ago I got interested in PHP and I now have three books on the subject. I've done a few things with php and I've seen the power and dynamism it brings to the table of content. I know how to structure and style content, but I need a language to control behavior. Obviously JS is one choice, but PHP has always drawn me in so much more (of course I am aware of certain differences). I still have a lot to learn about it and I cannot yet create my own scripts, so here is my plead for anyone with time on their hands.

 

My goal is to create a php script that will find out what browser a user is using. At that time, I would like for php to use if/else statements to inject a particular CSS file into being used for that page based on what client (browser) the user is using at the time.

 

Basically I want a script that will determine what browser the user has and implement a particular stylesheet (since some browsers see things wrong or not the same). I'm sure this is possible but I just don't know where to start. I've got ideas but I was told by a programmer that it's risky to try creating code without a base to build from.

 

Please, I wish learn to learn PHP very badly. Whether it be step by step or in one go, can someone show me how to make such a script?

 

Note: I would like for it to search in particular for the browsers MSIE, FF, and Opera.

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.