Jump to content

Css Style Switcher!


Recommended Posts

2 Options really....

1) Javascript.

2) Server-side solution.

I would personally use the latter due to the fact you don't need to rely on the user having javascript. You do however need to utilise a server-side technology on all pages you wish to use the style switching.

Basically use a dropdown menu and submit the value of the form to an intermediary script which sets a session variable. Then on the pages that display the styles use a conditional statement to check the value of the session variable and output the html for the style you wish to use.

If you want to save state between sessions you will need to set a cookie which can be retrieved on subsequent visits.

Link to comment
Share on other sites

2 Options really....

1) Javascript.

2) Server-side solution.

I would personally use the latter due to the fact you don't need to rely on the user having javascript. You do however need to utilise a server-side technology on all pages you wish to use the style switching.

Basically use a dropdown menu and submit the value of the form to an intermediary script which sets a session variable. Then on the pages that display the styles use a conditional statement to check the value of the session variable and output the html for the style you wish to use.

If you want to save state between sessions you will need to set a cookie which can be retrieved on subsequent visits.

cheers will try that!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...