title: How to run a PHP function from an HTML form?
body: <p>I'm absolute beginner in web technologies. I know that my question is very simple, but I don't know how to do it.
  For example I have a function: </p>
  
  <pre><code>function addNumbers($firstNumber, $secondNumber)
  {
      echo $firstNumber + $secondNumber;
  }
  </code></pre>
  
  <p>And I have a form:</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
  &lt;p&gt;1-st number: &lt;input type="text" name="number1" /&gt;&lt;/p&gt;
  &lt;p&gt;2-nd number: &lt;input type="text" name="number2" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="submit"/&gt;&lt;/p&gt;
  </code></pre>
  
  <p></p>
  
  <p>How can I input variables on my text fields and call my function by button pressing with arguments that I've wrote into text fields?
  For example I write 5 - first textfield, 10 - second textfield, then I click button and I get the result 15 on the same page.
  <strong>EDITED</strong>
  I've tried to do it so:</p>
  
  <pre><code>$num1 = $POST['number1'];
  $num2 = $POST['number2'];
  addNumbers($num1, $num2);
  </code></pre>
  
  <p>But it doesn't work, the answer is 0 always.</p>