title: How to execute second function without effecting first function in PHP?
body: <p>As the title says I want to execute second function after first function is executed. In other words, if user clicks 'Draw First number' button, a random number from 1-10 will be displayed along with a 'Draw Second number' button and then if user clicks 'Draw Second number' button, another random number from 1-10 will be displayed.</p>
  
  <p>I have tried the following code but when I click 'Draw Second Number' button, it returns me to the start of the process.</p>
  
  <pre><code> &lt;?php
     if (isset($_POST['firstnumber'])) {
  
     function roll () {
         return mt_rand(1,10);
     }
  
     echo 'First Number: '.roll().'&lt;form method="post"&gt;&lt;input type="submit" value="Draw second number" name="secondnumber"&gt;&lt;/form&gt;';
  
     if (isset($_POST['secondnumber'])) {
     echo 'Second Number: '.roll();
     }
     }
  
     ?&gt;
  &lt;form method="post"&gt;
     &lt;input type="submit" value="Draw first number" name="firstnumber"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I expect code to display second number when 'Second Number' button is clicked rather than going to initial code.</p>