Results 1 to 2 of 2

Thread: how can I change CSS link using external php?

  1. #1
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question how can I change CSS link using external php?

    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..

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •