Nieuw lid |
|
Ik heb op mijn site een script gemaakt voor verschillende styles alleen als je bijvoorbeeld bij mij invult: site.nl/index.php?style=wtf
krijg je de rode, een beetje raar maarja:
HTML:
<div id="style">
<ul>
<li id="style1" onclick="window.location='index.php?style=red'">
<li id="style2" onclick="window.location='index.php?style=blue'">
<li id="style3" onclick="window.location='index.php?style=green'">
<li id="style4" onclick="window.location='index.php?style=orange'">
</ul>
</div>
<li id="style1" onclick="window.location='index.php?style=red'"> <li id="style2" onclick="window.location='index.php?style=blue'"> <li id="style3" onclick="window.location='index.php?style=green'"> <li id="style4" onclick="window.location='index.php?style=orange'">
PHP:
<?
include('includes/db_connect.php');
// Start styler CONFIG
if ($_GET['style'] == "") {
$style = "@import url(/styles/default.css);";
}
elseif ($_GET['style'] == "red" or $_COOKIE['style'] == "red") {
setcookie("style", "", time()-3600, "/");
$style = "@import url(/styles/red.css);";
$color = $_GET['style'];
setcookie("style", $color, time()+3600, "/");
}
elseif ($_GET['style'] == "green" or $_COOKIE['style'] == "green") {
setcookie("style", "", time()-3600, "/");
$style = "@import url(/styles/default.css);";
$color = $_GET['style'];
setcookie("style", $color, time()+3600, "/");
}
elseif ($_GET['style'] == "orange" or $_COOKIE['style'] == "orange") {
setcookie("style", "", time()-3600, "/");
$style = "@import url(/styles/orange.css);";
$color = $_GET['style'];
setcookie("style", $color, time()+3600, "/");
}
elseif ($_GET['style'] == "blue" or $_COOKIE['style'] == "blue") {
setcookie("style", "", time()-3600, "/");
$style = "@import url(/styles/blue.css);";
$color = $_GET['style'];
setcookie("style", $color, time()+3600, "/");
}
else {
die ('This style is not defined.');
}
?>
<? include('includes/db_connect.php'); // Start styler CONFIG if ($_GET['style'] == "") { $style = "@import url(/styles/default.css);"; } elseif ($_GET['style'] == "red" or $_COOKIE['style'] == "red") { $style = "@import url(/styles/red.css);"; $color = $_GET['style']; } elseif ($_GET['style'] == "green" or $_COOKIE['style'] == "green") { $style = "@import url(/styles/default.css);"; $color = $_GET['style']; } elseif ($_GET['style'] == "orange" or $_COOKIE['style'] == "orange") { $style = "@import url(/styles/orange.css);"; $color = $_GET['style']; } elseif ($_GET['style'] == "blue" or $_COOKIE['style'] == "blue") { $style = "@import url(/styles/blue.css);"; $color = $_GET['style']; } else { die ('This style is not defined.'); } ?>
|