title: google chrome issue to send mail from HTML/PHP basic contact form
body: <p>I have a basic contact form for a web site I'm working on. I use HTML and PHP for do that. </p>
  
  <p>The HTML:</p>
  
  <pre><code>            &lt;form action="enviarc.php" method="post" name="contacto" target="pop" id="cntct-c" onsubmit="pop = window.open('about:blank','pop', 'width=400,height=250');this.submit(); this.reset(); return false;"&gt; 
                  &lt;p&gt;
                  &lt;input name="nombre" type="text" id="campos-n" class="form-imputs" size= "36" placeholder="Nombre *"/&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                  &lt;input name="email" type="text" id="campos-em" class="form-imputs"  size="36" placeholder="Email *"/&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                  &lt;input name="telefono" type="text" id="campos-te" class="form-imputs"  size="36" placeholder="Teléfono"/&gt;
                  &lt;/p&gt;
                  &lt;p&gt;
                  &lt;input name="celular" type="text" id="campos-ce" class="form-imputs"  size="36" placeholder="Celular"/&gt;
                  &lt;/p&gt;                    
                  &lt;p&gt;
                  &lt;input name="ciudad" type="text" id="campos-ci" class="form-imputs"  size="36" placeholder="Ciudad"/&gt;
                  &lt;/p&gt;
  
                  &lt;p&gt;
                  &lt;textarea name="mensaje" id="campos-m" class="form-imputs" cols="36" rows="6" placeholder="Mensaje *" style="height:100px;"&gt;&lt;/textarea&gt;
                  &lt;/p&gt;
  
                  &lt;input name="Submit" type="submit" class="form-buttons"  value="Enviar"/&gt;
                  &lt;input name="Clean" type="reset" class="form-buttons"  value="Limpiar"&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>And the PHP:</p>
  
  <pre><code>    &lt;?php
      if(isset($_POST['email'])) {
  
          $email_to = "xxx@xxx";
          $email_subject = "Contacto desde el formulario de xxxxxx";
  
          $nombre = $_POST['nombre'];
          $email = $_POST['email'];
          $telefono = $_POST['telefono'];
          $celular = $_POST['celular'];
          $ciudad = $_POST['ciudad']; 
          $mensaje = $_POST['mensaje'];
  
          $email_message .= "Nombre: ".($nombre)."\n";
          $email_message .= "Email: ".($email)."\n";
          $email_message .= "Telefono: ".($telefono)."\n";
          $email_message .= "Celular: ".($celular)."\n";
          $email_message .= "Ciudad: ".($ciudad)."\n";
          $email_message .= " \n";
          $email_message .= "Mensaje: ".($mensaje)."\n";
          //$email_message .= "Enviado el " . date('d-m-Y', time());
  
      // create email headers
      $headers = 'From: '.$email."\r\n".
      'Reply-To: '.$email."\r\n" .
      'X-Mailer: PHP/' . phpversion();
      mail($email_to, $email_subject, $email_message, $headers); 
  
      // Function to validate against any email injection attempts
      function IsInjected($str)
      {
        $injections = array('(\n+)',
                    '(\r+)',
                    '(\t+)',
                    '(%0A+)',
                    '(%0D+)',
                    '(%08+)',
                    '(%09+)'
                    );
        $inject = join('|', $injections);
        $inject = "/$inject/i";
        if(preg_match($inject,$str))
          {
          return true;
        }
        else
          {
          return false;
        }
      }
  
      ?&gt;
      &lt;!-- include your own success html here --&gt;
  
      Su mensaje fue enviado correctamente.&lt;br&gt;XXXXXXXX estara en contacto con usted.
  
      &lt;?php
      }
      ?&gt;
  </code></pre>
  
  <p>I'm not a php developer, i'm a web designer so i use some code from tutorials. The issues is that the code works great in firefox, send the email and works fine but in Google Chrome the form breaks and dont send the email. When click the "submit" button the pop up windows open and shown the "mesage sent" text, but the email doesn't send.</p>
  
  <p>I've searched arround the web and i've read about a problem between google chrome and PHP "$_POST" and "submit" but i cant fix the issues.</p>
  
  <p>Any suggestion is welcome or a link to a functionally php form tutorial what works in most browsers (although I read a lot and can not find one that works), is for a job and the time is finish me :) like every time...</p>