title: Passing values form one form into another - a weird case
body: <p>Please have a look to the following code:</p>
  
  <pre><code>&lt;?php
  
    $nomeDominio='';
  
    if (isset($_GET['infoDominio']))
    {          
        $nomeDominio = $_GET['nomeDominio'];
        echo "I'm getting ".$nomeDominio;
    }
  
    if (isset($_POST['atualizarDominio']))
    {
        echo "I'm posting ".$nomeDominio;
    }
  
  ?&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
  
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;Test Case 99&lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
  
          &lt;form name="infoDominio" action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']);?&gt;"  method="get"&gt;
  
              &lt;input id="nome_dominio" type="text" name="nomeDominio" value="&lt;?php echo $nomeDominio; ?&gt;"/&gt;
              &lt;br /&gt;
              &lt;button name="infoDominio" type="submit"&gt;Obtem informacao&lt;/button&gt;
  
          &lt;/form&gt;
  
          &lt;form action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']);?&gt;" name="atualizarDominio" method="post"&gt;
  
              &lt;input type="hidden" value="&lt;?php echo $nomeDominio ?&gt;" name="nome-dominio"/&gt;
              &lt;br /&gt;
              &lt;button type="submit" name="atualizarDominio"&gt;atualizar domínio&lt;/button&gt;
  
          &lt;/form&gt;
  
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>You can copy/paste - it will serve as test case.</p>
  
  <p>Like this, IF we <strong>get</strong> and then we <strong>post</strong>:
  The value from GET <strong><em>WILL NOT</em></strong> pass into POST.</p>
  
  <p>The thing is:
  If we just change the action= property of the second form element to, instead of having the $_SERVER['PHP_SELF'], to have just action=""; 
  you will notice that the value <strong><em>WILL</em></strong> pass.</p>
  
  <p>My question is:
  Why?</p>
  
  <p><strong>ADDITIONAL NOTE:</strong>
  This is not something to solve. Instead, this is something to understand why is it happening this way. 
  <strong>Why</strong>, if we change the action on the second form to <em>action=""</em>, the value stored in $nomeDominio pass from one conditional into another? The code sample can be used by itself, so you can perfectly test this very easily and see what I'm talking about.</p>