title: changing a PHP $SESSION value by clicking on a div
body: <p>I'm trying to change the value of a PHP session variable when the user clicks on a <code>div</code> element. </p>
  
  <p>There are several div elements on the page and each will change the session variable to a different value. </p>
  
  <p>At the moment I have the following code under the first div as a test but can't get it to change the variable's value.</p>
  
  <pre><code>&lt;div class="workpiece" onclick="&lt;?php $_SESSION['pageRef'] = 1; ?&gt;"&gt;    
  </code></pre>
  
  <p>I would greatly appreciate any  help as I'm very new to this.</p>
  
  <p>Thanks</p>