I’m trying to get a session variable to be set when clicking on a link.
The value of the variable is generated out of a DB using PHP. I’ve tried everything, but noting seems to work.
There is a foreach-loop that displays usernames. Each username is a link to a second page. The username that is clicked on should become the session variable.
The code that loops looks like this:
echo "<a href= 'nominate.php'> ".$myotherusers['username']. "</a><br/>";
goal being that when clicked on the link this code is executed:
$_SESSION['varname'] = $myotherusers['username'];
I just can’t seem to be able to figure out how…
thanks!
You could do something like this:
and then in your action: