title: How do I get two input values and add them together in php
body: <p>// What is the easiest way get these two values, store them in $total and make $total = to $first + $second and echo it in the html?</p>
  
  <pre><code>&lt;form action="testing123.php" method="get"&gt;
      1. &lt;input type="text" name="first"&gt;&lt;br&gt; 
      2. &lt;input type="text" name="second"&gt;&lt;br&gt;
   &lt;input type="submit"&gt;
  &lt;/form&gt;
  
  &lt;?php 
  $x = $_GET["first"];
  $y = $_GET["second"];
  $total = $x + $y;
  ?&gt;
  first: &lt;?php echo $_GET["first"]; ?&gt;&lt;br&gt;
  second: &lt;?php echo $_GET["second"]; ?&gt;&lt;br&gt;
  total: &lt;?php echo $_GET["total"]; ?&gt;
  </code></pre>