Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Switch stylesheets using cookies...

    Hi all!

    I am working on a project where I need to have the stylesheet change depending on which site the user is browsing.

    Let's say there are 7 sites. 6 of those sites have the same stylesheet. Number 7 has a different stylesheet.

    If people visit site 1-6 and then jump to 7, I want the same stylesheet to show throughout. So the stylesheet for site 7 has to match 1-6.

    If people visit site 7 and then jump to any of the other sites, I would like for them to see the same stylesheet as site 7, reflected on to the other sites.

    I believe I would use cookies to do this but i'm not really sure where to begin. Any leads or input on how to go about this would be much appreciated!

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Cookies have been covered very many times in this forum. Try using the search feature.

    Also have a look at

    http://www.thesitewizard.com/javascr...e-sheets.shtml

    It is your responsibility to die() if necessary….. - PHP Manual

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • Users who have thanked Philip M for this post:

    kjetterman (09-05-2012)

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,189
    Thanks
    10
    Thanked 569 Times in 550 Posts
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  • Users who have thanked rnd me for this post:

    kjetterman (09-05-2012)

  • #4
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you both!! I'm sure as I get going i'll have more questions but this will certainly get me started.


  •  

    Posting Permissions

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