title: change php session value by click
body: <p>i want to give a value to a session by clicking on </p>
  
  <p>i tried to do this , but its not working: </p>
  
  <pre><code>&lt;?php session_start(); 
  $_SESSION['role']="";?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
     &lt;head&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;link href="auth-buttons.css" rel="stylesheet" /&gt;
  &lt;link href="StyleSheet.css" rel="stylesheet" /&gt;
     &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="wrap"&gt;
  &lt;div id="wrapHome"&gt;
  &lt;p&gt;&lt;a class="btn-auth btn-facebook large" href="redirect.php" onclick="&lt;?php $_SESSION['role']="facebook" ?&gt;" &gt; Sign in with &lt;b&gt;Facebook&lt;/b&gt; &lt;/a&gt;&lt;/p&gt;
  
  &lt;p&gt;&lt;a class="btn-auth btn-twitter large" href="redirect.php" onclick="&lt;?php $_SESSION['role']="twitter" ?&gt;" &gt; Sign in with &lt;b&gt;Twitter&lt;/b&gt; &lt;/a&gt;&lt;/p&gt;
  
  &lt;p&gt;&lt;a class="btn-auth btn-google large" href="redirect.php" onclick="&lt;?php $_SESSION['role']="google" ?&gt;" &gt; Sign in with &lt;b&gt;Google&lt;/b&gt; &lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>