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! Link to comment https://forums.phpfreaks.com/topic/30434-php-and-hyperlinks/ 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] Link to comment https://forums.phpfreaks.com/topic/30434-php-and-hyperlinks/#findComment-140150 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.