News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

456Bereastreet.com:
Build your own PHP style sheet switcher
August 24, 2006 @ 15:19:11

At the 456 Berea St blog today, there's a popular new post that demonstrates a simple (yet effective) method for switching out the style sheets on your site at the whim of the user.

Want to have a style switcher that lets your site's visitors choose a different style sheet? Want it to work even if there is no JavaScript support? The trick is to use a server-side language like PHP, which is what I use for my style switcher.

Using PHP to let the user switch to a different CSS file is nothing new. But it is one of the things that I am often asked about, so I thought it would be good to have a write-up to refer people to in the future.

The code for the switcher is only about five lines long, implementation and all, but it's a nice, clean way to do it. It would break if the viewer didn't have cookies allowed on their system, though.

0 comments voice your opinion now!
style sheet switcher simple cookie import redirect style sheet switcher simple cookie import redirect


blog comments powered by Disqus

Similar Posts

Web Developement Blog: Curl: Location redirect while open_basedir is set

Jeremry Johnstone's Blog: PHP interface to Picasa Web Albums

Jonathan Snook's Blog: CakePHP, is it worth it?

Richard Thomas's Blog: Pjq - PHP Jquery helper

CyberInsecure.com: Half-Million Sites Mostly Running PHPBB Forum Software Hacked In Latest Attack


Community Events





Don't see your event here?
Let us know!


laravel configure list wordpress release series threedevsandamaybe code language application interview bugfix introduction community podcast symfony developer api library install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework