Hi, guys. How are you doing?
Well, I have been trying to figure out how to do style switcher stuff for a couple of weeks.
I was using JavaScript to do that. But it was pretty hard on me.
I found PHP switcher article in alistapart.com.
Could I ask you about that article?
Well, here is what I'd like to ask:
code:
<?php
setcookie ('sitestyle', $set, time()+31536000, '/', 'yourdomain.com', '0');
header("Location: $HTTP_REFERER");
?>
And article said:
quote:
The first step is to create a new file on your server named switcher.php and paste the following code into it. Blah blah balh~~~Then Don’t forget to put your own “yourdomain.com” into the script, or your cookie won’t be valid.
Can I ask you this? All I have to do is just copy this code on note pad then saved as php file, isn't it?
But I don't understand how to write my domain name. It said: 'yourdomain.com'. But I am using apache server installed on class room. I wrote like 'http://apache/~user20/html/switcher.php'
Is this right???
And also please look at this code:
code:
<link rel="stylesheet" type="text/css" href="<?php echo(!$sitestyle)?'red':$sitestyle ?>.css">
<link rel="alternate sylesheet" type="text/css" media="screen" href="./blue.css"/>
<link rel="alternate sylesheet" type="text/css" media="screen" href="./green.css"/>
<link rel="alternate sylesheet" type="text/css" media="screen" href="./black.css"/>
What is that href="./blue.css"? What does path mean??? I have never seen just one . in front of /. Hmm....
Please help me~.
Hiroki Kozai