title: How to populate input fields with PHP
body: <p>I'm trying to write a simple calculator html page where I ask for two numbers in separate text boxes, have the user click a button and then the result gets stored into a third text box. I'm trying to using PHP to resolve this but can't seem to display it the way I want.
  the echo line works fine, but I don't want that; </p>
  
  <p>From HTML</p>
  
  <pre><code>     &lt;form action="Add.php" method="get"&gt;
          &lt;input for='num1' type="text"  name="num1" /&gt;
          &lt;input for='num2' type="text" name="num2" /&gt;
  
          &lt;input type="submit" value="Add Them" /&gt;
          &lt;input type="text" name="AnswerBx" id="SumTotalTxtBx"/&gt;
      &lt;/form&gt; 
  </code></pre>
  
  <p>Add.php</p>
  
  <pre><code>     &lt;?php 
          $num1 = $_GET["num1"];
          $num2 = $_GET['num2'];
          $sum = $num1+$num2;
          //echo "$num1 + $num2 = $sum";
  
          document.getElementById("SumTotalTxtBx").value = $sum;
      ?&gt;
  </code></pre>