Drupal Cache & Stylesheet Switch -


I am using a very simple stylesheet switch from PHP. It was absolutely fine but the day before I turn on caching mode And now it only works for the login user. If caching mode is turned off, then it will work again for both users.

Actually the code looks like

.php header in the page

  & lt ;? Php if (isset ($ _ cookie ['style'])) {$ style = $ _ cookie ['style']; } And {$ style = 'green'; }? & Gt; & Lt; Link type = "text / css" rel = "stylesheet" href = "/ css /  

Switch to

  & lt; A href = "http://www.mydomain.com/switch.php? Style = blue" & gt; Blue & lt; / A & gt;  

in switch.php

  & lt ;? Php setcookie ('style', $ _GET ['style'], time () + 31536000); Header ('location:' $ HTTP_SERVER_VARS ['HTTP_REFERER']); ? & Gt;  

I did a lot of research, but could not get it right. Please help if you can. Thank you

Hmm, I do not think why you can not just use client-side style switcher, As this is the other way to completely client-side, but it seems a bit more to request a whole new page to switch styles.

In addition to this, creating a static page for working caching dynamically creates a new page for each hit, so the cached page may not be found which style switching is possible. Service is being provided.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -