Zigster316 Posted August 21, 2007 Share Posted August 21, 2007 I want to make a skin chooser out of a drop down menu but have no idea what to do. I know I need to use cookies bu what else do I need to do? Quote Link to comment https://forums.phpfreaks.com/topic/66061-solved-skin-chooser/ Share on other sites More sharing options...
rosierd Posted August 21, 2007 Share Posted August 21, 2007 Why not have a set of stylesheets for different colours and when they click a colour it then imports that stylesheet so in effect you have a new skin?? Quote Link to comment https://forums.phpfreaks.com/topic/66061-solved-skin-chooser/#findComment-330389 Share on other sites More sharing options...
Zigster316 Posted August 21, 2007 Author Share Posted August 21, 2007 How would I do that? Quote Link to comment https://forums.phpfreaks.com/topic/66061-solved-skin-chooser/#findComment-330417 Share on other sites More sharing options...
nathanmaxsonadil Posted August 22, 2007 Share Posted August 22, 2007 Do you have different css files? if you do put on the very top of your page <?php session_start(); ?> and in your head <?php echo "<link rel='stylesheet' type='text/css' href='{$_SESSION['theme']}' />"; ?> and then for your drop down menu <form name="theme_switcher" action="changetheme.php" method="GET"> <select name="theme_switcher"> <option value="blue" name="blue">Blue Theme</option> <option value="green" name="green">Green Theme</option> <option value="red" name="red">Red Theme</option> </select> </form> and for your changetheme.php <?php session_start(); if(isset($_GET['red'])) { $_SESSION['theme'] = 'red.css'; header("Location: http://www.yoursite.com/"); }else if(isset($_GET['green'])) { $_SESSION['theme'] = 'green.css'; header("Location: http://www.yoursite.com/"); else if(isset($_GET['blue'])) { $_SESSION['theme'] = 'blue.css'; header("Location: http://www.yoursite.com/"); }else header("Location: http://www.yoursite.com/"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/66061-solved-skin-chooser/#findComment-330482 Share on other sites More sharing options...
nathanmaxsonadil Posted August 26, 2007 Share Posted August 26, 2007 made a mistake if no theme is set than you include no css file change <?php echo "<link rel='stylesheet' type='text/css' href='{$_SESSION['theme']}' />"; ?> to <?php if(isset($_SESSION['theme'])) { echo "<link rel='stylesheet' type='text/css' href='{$_SESSION['theme']}' />"; }else echo "<link rel='stylesheet' type='text/css' href='youmaintheme.css' />"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/66061-solved-skin-chooser/#findComment-334515 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.