Hello. On my website, I am currently using a JS styleswitcher to allow users to switch between the old style and the new one. However, I received a comment that it isn’t working, even when they have JS enabled. Because of this, I decided to implement [url=”http://alistapart.com/articles/phpswitch/”]the PHP styleswitcher they have at ALA
I made a file and titled it switcher.php, and it had the following source in it:
[code=php]<?php
setcookie (‘sitestyle’, $set, time()+31536000, ‘/’, ‘216.36.173.149’, ‘0’);
header(“Location: $HTTP_REFERER”);
?>
I then made a link to it with this html:
[code]<a href=”switcher.php?set=white”>White</a>
Then, I modified my <link> tag that would normally import the stylesheet, to make it look like this:
[code]<link rel=”stylesheet” type=”text/css” media=”screen” title=”User Defined Style” href=”<?php echo (!$sitestyle)?’orange.css’:$sitestyle ?>.css” />
When I click on the link, though, it goes to switcher.php and gives me the following PHP error messages:
[quote]
Warning: Cannot modify header information – headers already sent by (output started at C:DanielWebsitesswitcher.php:9) in C:DanielWebsitesswitcher.php on line 10
Warning: Cannot modify header information – headers already sent by (output started at C:DanielWebsitesswitcher.php:9) in C:DanielWebsitesswitcher.php on line 11
Anyone know what I did wrong? I really need help on this one! Thanx,
-Dan