title: Submit form values to external URL shown displayed an iframe
body: <p>I am trying to make a form that on submit passes values to a external URL and show the results as an iframe. The form is the home page and the results must be shown in the first page as well.</p>
  
  <p>Everery time I submit it returns a 404 error.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;form id="buscaAereo" method="POST" name="formularioAereo" action="&lt;?php echo home_url('/' ); ?&gt;"&gt;
      &lt;fieldset&gt;
          &lt;div class="half"&gt;
              &lt;label class="radio"&gt;
                  &lt;input type="radio" name="idaevolta" id="idaevolta" value="1" checked&gt;
                  Ida e Volta
              &lt;/label&gt;
          &lt;/div&gt;
  
          &lt;div class="half"&gt;
              &lt;label class="radio"&gt;
                  &lt;input type="radio" name="idaevolta" id="idaevolta" value="2" checked&gt;
                  So ida
              &lt;/label&gt;
          &lt;/div&gt;
  
          &lt;div class="half"&gt;
              &lt;label for="name"&gt;Origem:&lt;/label&gt;
              &lt;input type="text" class="cidade" name="origem" data-provide="typeahead"&gt;
          &lt;/div&gt;
          &lt;div class="half"&gt;
              &lt;label for="name"&gt;Destino:&lt;/label&gt;
              &lt;input type="text" id="cidade" name="destino" data-provide="typeahead"&gt;
          &lt;/div&gt;
  
          &lt;div class="half"&gt;
              &lt;label for="name"&gt;Data de ida:&lt;/label&gt;
              &lt;div class="input-prepend"&gt;
                  &lt;span class="add-on"&gt;&lt;i class="icon-calendar"&gt;&lt;/i&gt;&lt;/span&gt;
                  &lt;input class="sapn1" id="date" name="ida" type="text"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="half"&gt;
              &lt;label for="name"&gt;Data de volta:&lt;/label&gt;
              &lt;div class="input-prepend"&gt;
                  &lt;span class="add-on"&gt;&lt;i class="icon-calendar"&gt;&lt;/i&gt;&lt;/span&gt;
                  &lt;input class="" id="date" name="volta" type="text"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="quarter"&gt;
              &lt;label for="country"&gt;Adultos:&lt;/label&gt;
              &lt;select id="country" name="adultos"&gt;
                  &lt;option value="0"&gt;00&lt;/option&gt;
                  &lt;option value="1" selected="selected"&gt;01&lt;/option&gt;
                  &lt;option value="2"&gt;02&lt;/option&gt;
                  &lt;option value="3"&gt;03&lt;/option&gt;
                  &lt;option value="4"&gt;04&lt;/option&gt;
                  &lt;option value="5"&gt;05&lt;/option&gt;
                  &lt;option value="6"&gt;06&lt;/option&gt;
                  &lt;option value="7"&gt;07&lt;/option&gt;
                  &lt;option value="8"&gt;08&lt;/option&gt;
                  &lt;option value="9"&gt;09&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
          &lt;div class="quarter"&gt;
              &lt;label for="country"&gt;Criancas:&lt;/label&gt;
              &lt;select id="country" name="criancas"&gt;
                  &lt;option value="1" selected="selected"&gt;00&lt;/option&gt;
                  &lt;option value="1"&gt;01&lt;/option&gt;
                  &lt;option value="2"&gt;02&lt;/option&gt;
                  &lt;option value="3"&gt;03&lt;/option&gt;
                  &lt;option value="4"&gt;04&lt;/option&gt;
                  &lt;option value="5"&gt;05&lt;/option&gt;
                  &lt;option value="6"&gt;06&lt;/option&gt;
                  &lt;option value="7"&gt;07&lt;/option&gt;
                  &lt;option value="8"&gt;08&lt;/option&gt;
                  &lt;option value="9"&gt;09&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
  
          &lt;div class="quarter"&gt;
              &lt;label for="country"&gt;Bebes:&lt;/label&gt;
              &lt;select id="country" name="bebes"&gt;
                  &lt;option value="1" selected="selected"&gt;00&lt;/option&gt;
                  &lt;option value="1"&gt;01&lt;/option&gt;
                  &lt;option value="2"&gt;02&lt;/option&gt;
                  &lt;option value="3"&gt;03&lt;/option&gt;
                  &lt;option value="4"&gt;04&lt;/option&gt;
                  &lt;option value="5"&gt;05&lt;/option&gt;
                  &lt;option value="6"&gt;06&lt;/option&gt;
                  &lt;option value="7"&gt;07&lt;/option&gt;
                  &lt;option value="8"&gt;08&lt;/option&gt;
                  &lt;option value="9"&gt;09&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
  
          &lt;div class="quarter"&gt;
              &lt;input type="submit" id="busca" name="submit" class="btn btn-primary botao" value="Pesquizar"&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And the PHP code:</p>
  
  <pre><code>function buscaPassagem() {
      if(isset($_POST['submit'])) {
          $idaevolta = $_POST["idaevolta"];
          $origem = $_POST["origem"];
          $destino = $_POST["destino"];
          $ida = $_POST["ida"];
          $volta = $_POST["volta"];
          $adultos = $_POST["adultos"];
          $criancas = $_POST["criancas"];
          $bebes = $_POST["bebes"];
  
          $link = "http://www.portaldoagente.com.br/OTAFrame/SuiteAerea/guiAereoAeroportos.aspx?PesquisaAutomatica=S&amp;Tipo="; 
  
          $UrlFinal = $link
              .$idaevolta
              ."&amp;Origem=".$origem
              ."&amp;Destino=".$destino
              ."&amp;Adultos=".$adultos
              ."&amp;Criancas=".$criancas
              ."&amp;Bebes=".$bebes
              ."&amp;DataIda=".$ida
              ."&amp;DataVolta=".$bebes
              ."&amp;LojaChave=bG9qYXRlbXBvc3Jpbw==";
  
          echo "&lt;script&gt;window.open('$UrlFinal', 'meu_frame');&lt;/script&gt;";
      }
  }
  </code></pre>
  
  <p>Does anyone know a solution?</p>