iarp Posted January 16, 2009 Share Posted January 16, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/141145-adding-attributes-to-links/ Share on other sites More sharing options...
revraz Posted January 16, 2009 Share Posted January 16, 2009 Sure, why not? Set a session or store it in a DB and just call it up. Quote Link to comment https://forums.phpfreaks.com/topic/141145-adding-attributes-to-links/#findComment-738771 Share on other sites More sharing options...
iarp Posted January 16, 2009 Author Share Posted January 16, 2009 There any ways todo this besides adding if statements to every link on every page? Quote Link to comment https://forums.phpfreaks.com/topic/141145-adding-attributes-to-links/#findComment-738775 Share on other sites More sharing options...
corbin Posted January 17, 2009 Share Posted January 17, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/141145-adding-attributes-to-links/#findComment-738796 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.