Jump to content


cookies, caching, and themes

  • Please log in to reply
2 replies to this topic

#1 Phrozin

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 27 July 2006 - 03:42 PM

Hi all. I started learning HTML and  PHP 4 days ago, and I've actually managed to make my own website (w00t!), but I have a problem I just can't figure out of find an answer to through google. I have my site setup so that a visiter can change themes by clicking on the little squares up top/right. This action sets a cookie that keeps the themes name. I also inserted code that caches the site to speed things up. Problem is that the cache doesn't take a theme into account, this results in the webpage being displayed in whatever theme was active when the cache was created.

Now I figured that if I include the cache file after the css link it would be fine (as it wouldn't cache the css link), but that means that everything above the css link would not be cached either. Everything I've been reading about caching says that the cache code has to be run before anything else is. is this true? will I be negating the effect of caching by starting after the css link? I'd post up some code, but I really don't know what code anyone would need to see, so I'll wait till you say something like "well, we need to see your code for cookies", or "we need to see the code for the themes" or whatever.

My website is static, but emulates having a DB. I do have MySQL, but I don't really want to use DBs because I had a premade (cookie cutter) CMS that got hacked. Am I pretty much fubar'd without a DB?

Thanks for reading and any help you can give.

#2 spfoonnewb

  • Members
  • PipPipPip
  • Advanced Member
  • 276 posts

Posted 27 July 2006 - 07:02 PM

I went to your site and clicked around changed the theme and stuff like that I didnt notice anything different, the theme stayed to whatever I choose, even if I left the site came back and refreshed.

The only way it went back to normal was if I deleted cookies.

#3 Phrozin

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 27 July 2006 - 07:25 PM

Yeah, I disabled caching on the site until I get it resolved.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users