title: get a session variable when clicked on link through foreach loop
body: <p>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. </p>
  
  <p>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:</p>
  
  <pre><code>echo "&lt;a href= 'nominate.php'&gt; ".$myotherusers['username']. "&lt;/a&gt;&lt;br/&gt;";
  </code></pre>
  
  <p>goal being that when clicked on the link this code is executed:</p>
  
  <pre><code>$_SESSION['varname'] = $myotherusers['username'];
  </code></pre>
  
  <p>I just can't seem to be able to figure out how...
  thanks! </p>