title: PHP increment integer onClick
body: <p>I've already searched for different ways to do this but no luck with fixing my problem.
  My code looks basically like this: </p>
  
  <pre><code>&lt;?php
     $attnum = 1;
  ?&gt;
  
  &lt;button type="button" onClick="&lt;?php $attnum++ ?&gt;"&gt;+&lt;/button&gt;
  &lt;h3&gt;&lt;em&gt;att&lt;?php echo "$attnum" ?&gt;: &lt;/em&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>When the page loads it have already added 1 on $attnum. I only want to add on $attnum when the button is pressed. What have I done wrong?</p>
  
  <p>Thanks</p>