PDA

View Full Version : CSS Stylesheet Switcher



jw06
April 6th, 2005, 08:57 PM
I'm trying to create a style selector.

I have the following code to check if $style is set in the url:


<?php
if (isset($_GET['style'])){
$style = $_GET['style'];
} else {
$style = style;
}
?>


I then have this as my link tag:
<link href="style/<?php $style; ?>.css" rel="stylesheet" type="text/css">

The link is being changed and $style is being set in the URL but its not changing the style.....

http://www.arctichosts.com/index.php

Lukus
April 6th, 2005, 09:32 PM
<link href="style/<?php echo($style); ?>.css" rel="stylesheet" type="text/css">

??

jw06
April 6th, 2005, 09:38 PM
Hmm, Kind of works? Does the cream style work for anybody?

http://www.arctichosts.com/index.php

Lukus
April 6th, 2005, 10:02 PM
it changes definately, but theres no cream style...

is cream.css actually stored in a folder called "style" ? cos thats what its lookin for...

jw06
April 6th, 2005, 10:12 PM
Yea it actually in there..

http://www.arctichosts.com/style

jw06
April 6th, 2005, 10:13 PM
***NVM

GOT IT! Woohoo.. lol the cream style.. is experimental.. dont.. lol its ugly.. so dont look at it... Its just to test with

Lukus
April 6th, 2005, 10:41 PM
Good :)