Jump to content

Adding attributes to links


iarp

Recommended Posts

Hey,

 

Question... On my site i have the ability to add ?theme=blahblahhere and it'll change to that theme temporarily.

 

But i'm wondering if theres an ability out there to have the GET['theme'] attribute added to all internal links so that when you change pages you don't need to manually add it.

Link to comment
https://forums.phpfreaks.com/topic/141145-adding-attributes-to-links/
Share on other sites

You could even store it in a cookie.

 

 

 

Something like:

 

if(isset($_GET['style']))
    setcookie('style', $_GET['style'], time() + 86400*31);

$style = (isset($_COOKIE['style'])) ? $_COOKIE['style'] : 'default';
if(!valid style) $style = 'default';

 

 

Then you would just handle style stuff based on $style.

 

$style could hold the name of a style sheet or something.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.