I’m trying to make a PHP css switcher so you can simply click a link and it will change the color schemes. I’ve been trying for quite a while now and can’t seem to get it to work.
Site [url]http://illegal3alien.ath.cx
Main Page – [url]http://illegal3alien.ath.cx/main.php
[code=html]<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
<link rel=”stylesheet” type=”text/css” media=”screen” title=”User Defined Style” href=”<?php echo (!$sitestyle)?’main’:$sitestyle ?>.css” />
</head>
<body>
<a href=”switcher.php?set=red”>click here to change to RED style!</a>
</body>
</html>
The switcher.php code is:
[code=php]<?php
setcookie (‘sitestyle’, $set, time()+31536000,’/’, ‘illegal3alien.ath.cx’, ‘0’);
header(“Location: $HTTP_REFERER”);
?>
Anyone tell me what’s wrong and how to fix it?