Home General Chat
If you need urgent support, call 999 or go to your nearest A&E. To contact our Crisis Messenger (open 24/7) text THEMIX to 85258.
Options

Website Colour 3 Versions

Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
Okay, What i want to do is have a little "box" where a user will choose there colour version of the website here are the three below

Blue
Red
Green

Im sure its some PHP Code or something, Because i don't really want to create 3 sets of 1 website (if you get me)

Comments

  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Why? Are you selling them? If so then I don't see the point in what you are saying... Thise colors don't look to great either... and what are those gaps between the tables?

    Get something like JASC Paintshop, where you can color pick, and copy and paste html codes. It's what I use. I don't know what designing software you use but invest in something like dreamweaver

    Have a look around www.dynamicdrive.com for code and script!
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    If you're talking about allowing the user to choose which CSS file they want to view the website in, I think there's a Javascript that allows users to switch CSS files. Don't know where though....
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Yeah, you can do javascript or PHP CSS switchers that will change the style-sheet for you. PHP + a cookie is probably the most seemless. Just google for PHP style switcher if you need to, though it's a fairly easy bit of code to do yourself - just set a cookie depending on the form selection, and then, if the cookie is there when the page loads, pick up the relevant style sheet and pop the bit of code in with an if block.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    pah1986 wrote: »
    If you're talking about allowing the user to choose which CSS file they want to view the website in, I think there's a Javascript that allows users to switch CSS files.

    Thank you :)

    - I do have dreamweaver, Choose not to use it for my Personal website though.


    Thank you mist! ill have a moogle around now
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    okay i [M]oogled around and found a site and was copying the php and editing one or 2 things but erm im getting stuck why can't there be a step by step thing!:crying:
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    CoolMe wrote: »
    okay i [M]oogled around and found a site and was copying the php and editing one or 2 things but erm im getting stuck why can't there be a step by step thing!:crying:

    There probably is a step by step thing somewhere.

    What are you stuck with?
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    if you go to Here You see the error i get.

    Im totally confused!

    And then if you look Here

    you see some other error when you choose from the drop down list
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    ok the first error you could be missing a quote mark or a semicolon.

    The second error seems to be related.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Have you got an editor that highlights PHP source code like gVIM or something? Would make any mismatched quotes obvious.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Nope ill check now and get that program you spoke about

    I only have switcher.php & menu.php to do the whole "style thing"
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    okay i dont think that program worked...

    Heres the code for switcher.php

    <?php
    setcookie ('sitestyle', $set, time()+31536000, »
    '/', 'http://www.jayswebby.net/v2/', '0');
    header("Location: $HTTP_REFERER");
    ?>
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    get rid of the >> and join everything from setcookie to the semicolon onto one line.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Mist wrote: »
    get rid of the >> and join everything from setcookie to the semicolon onto one line.


    Like this?

    <?php
    setcookie('sitestyle', $set, time()+31536000,'/', 'http://www.jayswebby.net/v2/', '0');header("Location: $HTTP_REFERER");
    ?>
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Woo when i got to menu.php on the web and choose a colour it directs me to v2/ which is good i think!

    I'm going to try something with the menu.php script now
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    CoolMe wrote: »
    Woo when i got to menu.php on the web and choose a colour it directs me to v2/ which is good i think!

    I'm going to try something with the menu.php script now


    This is progress then I think.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Mist wrote: »
    This is progress then I think.

    And suddenly we come to a hault!

    Okay the menu script is below, all it does is direct me to /v2

    <form action="switcher.php" method="post">
    <select name="set">
    <option value="/blue" »
    selected>Blue</option>
    <option value="/green">
    Green</option>
    selected>/red</option>
    <option value="/red">Red</option>
    </select>
    <input type="submit" value="Decide">
    </form>
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Jase sent me the files on msn and realised its not quite what he needed so i coded him a brand new script works great now :).
Sign In or Register to comment.