title: PHP post two values in one field, one of which is hidden
body: <p>Is there a way that I can post two values at the same time from a single field in a table but hide one from the user?</p>
  
  <p>I would like the following form to post the values <code>ID</code> and <code>reason_name</code> when it is submitted but have the user only be able to see (and edit in the text box) the <code>reason_name</code>.</p>
  
  <pre><code>&lt;form name="add_positioning" method="post" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;"&gt;
      &lt;table border="1" class="autoTable_pos"&gt;
          &lt;tr&gt;
              &lt;td&gt;Positioning&lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;/tr&gt;
          &lt;?
          $sql= "SELECT * FROM gradeReason WHERE reason_userID = $user_id AND category = 'positioning' AND current = 1";
          $result = mysqli_query($mysqli,$sql) or die(mysqli_error($mysqli));
          while($row = mysqli_fetch_array($result)){?&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="reason[]" size="25" value="&lt;? echo $row['reason_name']; ?&gt;"/&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="button" value="Delete" class="delRow_pos"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
              &lt;?
          }
          ?&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" name="reason[]" size="25"/&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="button" value="Delete" class="delRow_pos"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="2" align="right"&gt;
                  &lt;input type="submit" value="Save" name="save_reasons"/&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The form POST action so far (basic echo at the moment for my own sanity to check that it posts the values correctly, which it does...)</p>
  
  <pre><code>if(isset($_POST['save_reasons'])) {   
      foreach($_POST['reason'] as $item) {
          echo $item.'&lt;br/&gt;';
      }
  }
  </code></pre>
  
  <p>This table displays the values that are held in a database but enables the user to add more values by dynamically adding a new row (using <code>JQUERY</code> I haven't included) to the table when they type in an empty one at the bottom and also allows them to edit or delete existing values.</p>
  
  <p>For each value posted I intend to check if the <code>ID</code> value is empty, if it is it means that it is a new value and enter a new record into the database, if it isn't update the existing record in the database with the corresponding <code>ID</code>.  I don't have a problem writing that bit, I just can't think how to get the <code>ID</code> value posted as well as the <code>reason_name</code> while keeping <code>ID</code> hidden from the user.</p>