title: Why are HTML Input element ID attribute values being prefixed in a form I am emailing?
body: <p>I am using PHP to compose a HTML form to be sent by email. I have, for example, code like this:</p>
  
  <pre><code>$userOutput .= '&lt;input type="hidden" id="seenUser" name="seenUser" value="'.$lastUsername.'"&gt;';
  $userOutput .= '&lt;input type="hidden" id="seenToken" name="seenToken" value="'.$userToken.'"&gt;';
  </code></pre>
  
  <p>When that email arrives in my inbox, if I use Firefox's code inspector, it shows the elements as:</p>
  
  <pre><code>&lt;input type="hidden" id="x_683480324seenUser" name="seenUser" value="someUsername"&gt;
  &lt;input type="hidden" id="x_683480324seenToken" name="seenToken" value="6ed3738a6e20f56f83ec83d9ef77a169"&gt;
  </code></pre>
  
  <p>Why do the id attribute values have prefixes <code>x_683480324</code>?</p>
  
  <p>On the page intended to receive the form submission, I am using:</p>
  
  <pre><code>if (isset($_POST['seenUser'])&amp;&amp;isset($_POST['seenToken'])) {
  </code></pre>
  
  <p>... and this is obviously failing on account of the unpredictable prefix.</p>
  
  <p><strong>Long Version</strong></p>
  
  <p>Here is the form as it appears in my web mail. Clearly the <code>onSubmit</code> has been added by my web mail provider. It seems reasonable to conclude the changes to the <code>form</code> <code>id</code> value, as well as those in my question - <code>input</code> <code>id</code> values - were probably also modified by the web mail provider. </p>
  
  <pre><code>&lt;form id="x_-381141859birdsSeen" action="https://www.MYDOMAIN.com.au/MYPAGE.php" method="post" onsubmit="return window.confirm(&amp;quot;You are about to send information to an external page. Do you want to continue?&amp;quot;);" target="_blank"&gt;
      &lt;h4&gt;Pacific Baza &lt;input type="checkbox" name="pacbaz1" value="pacbaz1"&gt;&lt;/h4&gt;
      2019-10-23 - &lt;a href="https://www.OBFUSCATED.org/" target="_blank"&gt;AU-NSW-KRG&lt;/a&gt;
      &lt;br&gt;
      &lt;h4&gt;Whiskered Tern &lt;input type="checkbox" name="whiter2" value="whiter2"&gt;&lt;/h4&gt;
      2019-10-22 - &lt;a href="https://www.OBFUSCATED.org/" target="_blank"&gt;AU-NSW-NEW&lt;/a&gt;
      &lt;br&gt;
      &lt;input type="hidden" id="x_-381141859seenUser" name="seenUser" value="OBFUSCATED"&gt;
      &lt;input type="hidden" id="x_-381141859seenToken" name="seenToken" value="8c1865d190e5a11d2cfe548224bf8d56"&gt;
      &lt;input type="submit" value="Seen them!"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Before getting a lecture, I understand that it may be the case not all mail providers will support the use of a form in email. Be that as it may, this form <em>does</em> work when I modify my checking of the $_POST parameters (compared with the code given in the question above) per below:</p>
  
  <pre><code>foreach($_POST as $postName=&gt;$postValue) {
  
      echo 'PostVar: '.$postName.'&lt;br /&gt;';
  
      if (substr($postName, -8)==='seenUser'&amp;&amp;strlen($postName)&gt;8) { // The POST variable name is longer than 8 chars and the last 8 chars are 'seenUser'
          $postedSeenUser = $postValue; // assign the convoluted variable's value to our nice simple name
      }
  
      if (substr($postName, -9)==='seenToken'&amp;&amp;strlen($postName)&gt;9) { // The POST variable name is longer than 9 chars and the last 9 chars are 'seenToken'
          $postedSeenToken = $postValue; // assign the convoluted variable's value to our nice simple name
      }
  
      if ($postName==='seenUser') $postedSeenUser = $postValue;   // Just in case the variable arrives with nice clean name as desired
      if ($postName==='seenToken') $postedSeenToken = $postValue; // Just in case the variable arrives with nice clean name as desired
  
  } // And now our variables should contain nice neat seenUser and seenToken values if they existed in some convoluted manner.
  
  if (isset($postedSeenUser)&amp;&amp;isset($postedSeenToken)) {
  </code></pre>
  
  <p>While it may be the case it is those last two "catch the simple case" statements that lead the above to work, the question remains as to why the following should not have worked in the first place:</p>
  
  <pre><code>if (isset($_POST['seenUser'])&amp;&amp;isset($_POST['seenToken'])) {
  </code></pre>