title: How can I edit a PHP variable if i click on a button?
body: <p>I would like to know how I change a PHP variable if I click on a button. Let's say I have the following webpage:</p>
  
  <pre><code>_______________________________________________
  |   Menu    |         A Webpage                |
  |           |                                  |
  | - item1   |                                  |
  | - item2   |                                  |
  | - item3   |          Content                 |
  | - item4   |                                  |
  |           |                                  |
  |           |                                  |
  </code></pre>
  
  <p>And if I click on 'item1' the page changes with the data that is related to the user that is linked with that button. So does it with the other items. </p>
  
  <p>This is currently my code:</p>
  
  <pre><code>&lt;script&gt;
  function test1()
  {
  alert("Hello World1!");
  }
  function test2()
  {
  alert("Hello World2!");
  }
  function test3()
  {
  alert("Hello World3!");
  }
  function test4()
  {
  alert("Hello World4!");
  }
  
  
  &lt;/script&gt;
  
  
      &lt;a id="test1" href="#" onClick="test1();"&gt;&lt;h5&gt;item1&lt;/h5&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;a id="test2" href="#" onClick="test2();"&gt;&lt;h5&gt;item2&lt;/h5&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;a id="test3" href="#" onClick="test3();"&gt;&lt;h5&gt;item3&lt;/h5&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;a id="test4" href="#" onClick="test4();"&gt;&lt;h5&gt;item4&lt;/h5&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
  </code></pre>
  
  <p>This is is enough to let a window appear or to hide a division or something. But what I want is if a button is clicked I want to change a PHP variable. Like this:</p>
  
  <pre><code>&lt;script&gt;
  function test1()
  {
  &lt;? $userid == '1'; ?&gt;
  }
  &lt;/script&gt;
  
  
      &lt;a id="test1" href="#" onClick="test1();"&gt;&lt;h5&gt;item1&lt;/h5&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
  </code></pre>
  
  <p>With this I can easily change the page to what the user wants to see, without the need to make multiple pages. But my question is: 'how can I make this possible'? </p>
  
  <p>I would like to thank you all in advance!</p>