PDA

View Full Version : how can I change CSS link using external php?



Whitesky
12-16-2009, 01:21 AM
Hello, basically I am trying to change the link to my style sheet in the head of my index, by using an external php page with dropdown menu. Let's say someone selects "Style 3 - Green" from the dropdown and it automatically changes the link in the index to "style_green.css", is this possible, without using databases? I am trying to allow the user to select various css files without manually changing links in the index.

Thanks..

bluewalrus
12-16-2009, 02:09 AM
Not using PHP alone. PHP is triggered only when a page is loaded. You could do it with javascript. If you dont mind the page reloading everytime than you could make the menu a form and in the head make the link to the stylesheet conditional.