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 Coder
    Join Date
    Dec 2005
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking two css files to one page

    Ok. I have been searching an answer to this problem for a few days. Is it possible to let the user select which css file to apply to the wesite he is viewing? Eg. I have red.css and blue.css. How do I apply these css files to the webpage he is viewing based on his choice by selecting from a hyperlink?

    Also, how do I transfer these settings when the person moves to another page in the website?

    Thanks in advance...

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Switcher

    A PHP Switcher might be what you're looking for...
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    The switcher.php won't work on PHP 4.2 and above with the default setup, as it realises on register_globals. It also hits problems if the browser doesn't send the referrer, or there isn't one.

    Here's my modified version:

    PHP Code:
    <?php
    setcookie 
    ('sitestyle'$_GET['set'], time()+31536000'/''yourdomain.com''0');
    if (empty(
    $_SERVER['HTTP_REFERER']))
        
    header('Location: /');
    else
        
    header("Location: $_SERVER[HTTP_REFERER]");
    ?>

  • #4
    Regular Coder oldcrazylegs's Avatar
    Join Date
    Feb 2004
    Location
    East Moline Illinois USA
    Posts
    414
    Thanks
    4
    Thanked 5 Times in 4 Posts


  •  

    Posting Permissions

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