Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // styleswitch.php
- $style = $_GET['style'];
- if(!is_numeric($style)) {
- die();
- }
- $value = null;
- switch($style) {
- case '1':
- $value = "default.css";
- break;
- case '2':
- $value = "darksky.css";
- break;
- case '3':
- $value = "halext.css";
- break;
- case '4':
- $value = "flashii.css";
- break;
- case '5':
- $value = "zeniea.css";
- break;
- default:
- $value = "default.css";
- break;
- }
- setcookie("blogStyle", $value, time() + 315569260);
- header('Location: ' . $_SERVER['HTTP_REFERER']);
- // This goes in the webpage
- <link rel="stylesheet" type="text/css" href="css/<?php if(!isset($_COOKIE["blogStyle"])) { echo 'default.css'; } else { echo $_COOKIE['blogStyle']; } ?>" />
- <li>Style Switcher: </li>
- <li><a href="styleswitch.php?style=1">Default</a></li>
- <li><a href="styleswitch.php?style=2">Darksky</a></li>
- <li><a href="styleswitch.php?style=3">Halext</a></li>
- <li><a href="styleswitch.php?style=4">Flashii</a></li>
- <li><a href="styleswitch.php?style=5">Zeniea</a></li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement