title: Using $_POST data to create a new html form value
body: <p>I'm using <code>post</code> to send info to  my page. I'm using that to create a variable and pass that variable to a new <code>&lt;input&gt;</code>. However, when I submit the new form, the variable is blank.</p>
  
  <p>The variable is created from post data:</p>
  
  <pre><code>$timenotstarted = $_POST["placeholder"]; 
  </code></pre>
  
  <p>Then inline in the html:</p>
  
  <pre><code>&lt;form name="newform" method="post" action="insert.php"&gt;
  &lt;input type="text" name="timerset" value="&lt;?php echo $timenotstarted; ?&gt;"&gt;
  &lt;input type="submit" value="Submit"&gt;&lt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When the new form is submitted, the variable whose <code>name="timerset"</code>, is blank. </p>
  
  <p>When I echo <code>$timenotstarted</code> on the same page that this form is, </p>
  
  <p>it will show its value. It just "goes away" when I try to use it in the new form.</p>
  
  <p>Edit: Here's what's happeneing:
  <img src="https://i.stack.imgur.com/IbI9e.gif" alt="enter image description here"></p>
  
  <p>Not sure if this helps: <a href="http://forexguruguide.com/timer/insert.php" rel="nofollow noreferrer">http://forexguruguide.com/timer/insert.php</a></p>
  
  <p>And here's the whole shabang:</p>
  
  <pre><code>&lt;?php include 'connect.php';
  $timenotstarted = $_GET["placeholder"];
  $start = $_POST["start"];
  $timerset = $_post["timerset"];
  echo $timenotstarted . '&lt;br /&gt;';
  echo $start . '&lt;br /&gt;';
  echo $timerset . '&lt;br /&gt;';
  ?&gt;
  
  &lt;form name="timeform" method="get" action="insert.php"&gt;
  &lt;select name="placeholder"&gt;
    &lt;option value="1"&gt;1 min&lt;/option&gt;
    &lt;option value="3"&gt;3 min&lt;/option&gt;
    &lt;option value="5"&gt;5 min&lt;/option&gt;
    &lt;option value="10"&gt;10 min&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="submit" value="Set timer"&gt;
  &lt;/form&gt;
  
  &lt;form name="startform" method="post" action="insert.php"&gt;
  &lt;input type="hidden" value="1" name="start"&gt;
  Timer set to: &lt;input type="text" name="timerset" value="&lt;?php print $timenotstarted?&gt;"&gt;
  &lt;input type="Submit" value="Start Timer"&gt;
  &lt;/form&gt;
  
  &lt;?php
  
  if ($start==1) {
    $target = time() + ($timerset * 60);
    mysql_query("UPDATE countdowntimer SET target='$target' WHERE id='0'");
    mysql_query("UPDATE countdowntimer SET timenotstarted='null' WHERE id='0'");
    echo 'Timer started' . '&lt;br /&gt;';
    echo $target . '&lt;br /&gt;';
    echo time(); }
  else if (!empty($timenotstarted)) {
    $timenotstarted .= ":00";
    mysql_query("UPDATE countdowntimer SET timenotstarted='$timenotstarted'");
    echo 'Timer set to: ' . $timenotstarted; }
  else {
    echo 'Set the timer then start the timer'; }
  ?&gt;
  </code></pre>