title: PHP variable in hidden field carries over as a string literal to the next page
body: <p>I'm working on a small assignment and ran into an issue I can't seem to figure out. The assignment consists of three pages. The first page consists of a simple field that accepts user input. The second page validates that input, and if valid, displays a second input field. The third page validates page 2 input, then adds it to page 1 input. </p>
  
  <p>I've used a hidden field to store page 1 input on page 2, in order to submit it to page 3. But, because page 2 has to display the form only if the previous input is valid, I implemented the form inside a php conditional statement. So, I directly referenced the php variable holding page 1 input as the hidden field value. Here is my page 2 code:</p>
  
  <pre><code>&lt;?php
  if (isset($_POST["get_number1"] )) {
  $number1 = $_POST['get_number1'];
  $button_pressed = $_POST['sbmt'];
  $message;
  $error1 = false;
  if ($number1==null) {
      $message = 'ERROR: input field empty';
      $error1=true;
  }
  else if (!is_numeric($number1)) {
      $message = 'ERROR: input must be numeric';
      $error1=true;            
  }
  else if (strpos((String)$number1,'.')!=null &amp;&amp; strlen((String)$number1)-strpos((String)$number1,'.')&gt;4) {
      $message = 'ERROR: input must contain 0 to 3 decimals';
      $error1=true;
  }
  else if (!strcmp($button_pressed,"sbmt")){
      $message = 'ERROR: submit button not pressed';
      $error1 = true;
  }
  }
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;GetNumber2.html&lt;/title&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;?php
      if ($error1==true){
         echo $message .'&lt;br&gt;'. '&lt;a href="GetNumber1.html"&gt;Return to Form 1&lt;/a&gt;';
      }
      else {
          echo 'Your number 1: '.$number1.
           '  &lt;form action="AddNumbers.php" method="post"&gt;
              &lt;label&gt;Enter the second number (format : 999999.999) :&lt;/label&gt;
              &lt;input type="text" name="get_number2"&gt;
              &lt;input type="submit" name="sbmt" value="SubmitNumber"&gt;
              &lt;input type="hidden" name="hf_number1" value="$number1";&gt;             
              &lt;/form&gt;
           ';
      }
      ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The next page displays the hidden field value as $number1, even if I remove the quotation marks. Any hints would be appreciated. Thank you.</p>