title: Changing PHP Session variables on click event
body: <p>Please help me on this problem. It is small but causing me lot of trouble.I have set the session variable in my index.php and when clicked on anchor tag , it is not changing the session variable.
  Relevant PHP part:</p>
  
  <pre><code>session_start();
  $_SESSION["amount"] = "99";
  </code></pre>
  
  <p>Now the html part (in same PHP file).</p>
  
  <pre><code>&lt;a onclick="change('&lt;?php echo $_SESSION['amount']='399'; ?&gt;')" href="#"&gt;&lt;h4&gt;Order 399&lt;/h4&gt;&lt;/a&gt;
  
  &lt;a onclick="change('&lt;?php echo $_SESSION['amount']='200'; ?&gt;')" href="#"&gt;&lt;h4&gt;Order 200&lt;/h4&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I am checking the value of Session variable in another div in same file.</p>
  
  <pre><code>&lt;td&gt;Amount: &lt;?php echo $_SESSION["amount"] ?&gt; &lt;/td&gt;
  </code></pre>
  
  <p>the value shown is 200 though clicked on "Order 399".</p>
  
  <p>How do I change session variable?Am I mixing Client side and server side?
  Please help me and do suggest the shortest possible way to do it.</p>