dekonstruct Posted December 13, 2006 Share Posted December 13, 2006 Hi, I was wondering how to go about setting variables within a hyperlink. Here's the php part of what I'm trying to do (forgive my clunky code):[code]$_SESSION['date'] = date('z');$counter = 0;$_SESSION['nav'] = "c";switch($_SESSION['nav']){ case b: echo "forward"; $counter = $counter + 1; break; case a: echo "backward"; $counter = $counter - 1; break; default: echo "nowhere";}$_SESSION['dateprint'] = date('z') + $counter;?>[/code]and I'm trying to set the $_SESSION['nav'] variable within a hyperlink, and I've tried a couple of different ways that don't work. examples:[code]<a href="index.php?nav=a;><a href="index.php?_SESSION[nav]=b;">[/code] any help would be greatly appreciated thanks! Quote Link to comment Share on other sites More sharing options...
trq Posted December 13, 2006 Share Posted December 13, 2006 Not exactly sure what your trying to do here.... maybe?[code]<a href="index.php?nav=<?php echo $_SESSION['nav'] ?>">[/code] Quote Link to comment 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.