Aqua-Soft Forums: PHP Style Switcher - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Style Switcher Rate Topic: -----

#1 User is offline   nicholasheer Icon

  • Group: News Posters
  • Posts: 820
  • Joined: 15-July 05

Posted 13 December 2007 - 05:25 AM

I designed a really cool (well, at least, I think it is) alternate style sheet for my website. Unfortunately, both of the PHP switcher codes I've tried can't load the default style, or my modified one.

The first I used was the About.com script.

My website is organized like this:
-splash page
--/home/
---default.htm
--/getinfo/
---default.htm
--/resources/
---styles.css *this is the default style sheet*
---stylesv.css *this is the "vintage" style sheet*


The bold text is the "resources" area, where the style sheets and images are located.

My code looked like this (in an abbreviated format here; the full code is too long and unnecessary):
<head>

<link rel="stylesheet" type="text/css" href="<?php echo (!$style)?'../resources/styles':$style ?>.css" />

</head>


The PHP looked like this:
<?php 

$Year =31536000 + time();

setcookie ('style', $choice, $year);

header("Location: $HTTP_REFERER"); 

?>


<a href="../resources/changestyle.php?choice=styles">Default Style</a> | <a href="changestyle.php?choice=stylesv">Vintage Style</a>


I tried both with "../resources/" and without that string in the code, and it made no difference.

Then I tried the A List Apart script, but with no luck on that either.

Currently, I am on my third method, but it isn't working either. I lost the link to it, however.

I think my code is formatted correctly, but I know it obviously isn't, because it isn't working. What am I doing wrong?

For reference:
My website (this one doesn't have the switching code) | My website with the testing switching code
0

#2 User is offline   nicholasheer Icon

  • Group: News Posters
  • Posts: 820
  • Joined: 15-July 05

Posted 18 December 2007 - 02:47 AM

EDIT: I figured it out. I tossed the old code and used a different method, which works nicely. You can see it at http://www.nheerdesign.co.nr/
0

#3 User is offline   rick22 Icon

  • Group: Member
  • Posts: 14
  • Joined: 28-February 08

Posted 01 March 2008 - 10:50 AM

man... :D i don't like About.com's script at all.. thats my view...
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic