由于action属性,HTML5提交按钮无法正常工作?

时间:2014-07-07 17:48:09

标签: php html5 submit action

我偶然发现了一个无法解决的问题。我在HTML5中制作了这个小型联系表格,如下所示 想通过提交按钮发送表单。无论我做什么,按钮都没有响应。据我所知,不再需要action属性来触发我放在index.php标题之上的php代码。有人可以快速查看并指导我找到可能的解决方案吗?到目前为止,我试图将邮件程序放在一个单独的php文件中,但按钮却没有响应。有什么我想念的吗?非常感谢!

<?php

### Setting up the contact formular ###

# send mail to whom?
$strEmpfaenger = 'michael.schwark@googlemail.com';

# has been sent from?
$strFrom       = '"omigretchen.de" <service@omigretchen.de>';

# with which subject?
$strSubject    = 'Mensaje www.omigretchen.de';

# where to go for success message?
$strReturnhtml = 'http://www.omigretchen.de/danke.html';

# which seperators to use in the email body?
$strDelimiter  = ":\t";

### Ende Konfiguration ###

if($_POST)
{

 if($_POST['NOMBRE'] && $_POST['EMAIL'] && $_POST['TELEFONO'])
{
 $strMailtext = "";

 while(list($strName,$value) = each($_POST))
 {
  if(is_array($value))
  {
   foreach($value as $value_array)
   {
    $strMailtext .= $strName.$strDelimiter.$value_array."\n";
   }
  }
  else
  {
   $strMailtext .= $strName.$strDelimiter.$value."\n";
  }
 }

}
 else $strReturnhtml = 'http://www.omigretchen.de/problem.php';

 if(get_magic_quotes_gpc())
 {
  $strMailtext = stripslashes($strMailtext);
 }

 mail($strEmpfaenger, $strSubject, $strMailtext, "From: ".$strFrom)
  or die("No se puede enviar un email.");
 header("Location: $strReturnhtml");
 exit;
}

?>

<div id="formulario"><form id="form" class="form" name="form" method="post" accept-charset="UTF-8" autocomplete>
<h1>¿Como podemos ayudarle?</h1>
<div class="content">
    <div class="intro">Si no le hemos llamado plazo de 24 horas por favor llame al: 611 392 38.</div>
    <div id="section1" >
        <div class="field"><label for="NOMBRE">NOMBRE</label><input id="NOMBRE" name="NOMBRE" type="text"></div>
        <div class="field"><label for="TELEFONO">TELÉFONO</label><input id="TELEFONO" name="TELEFONO" required type="tel"></div>
        <div class="field"><label for="EMAIL">EMAIL</label><input id="EMAIL" name="EMAIL" type="email"></div>
    </div>
    <div id="section2" >
        <div class="field"><div class="edit-options"><div class="edit"></div><div class="delete"></div></div><label for="Deseo"></label><textarea id="Deseo" name="Deseo" placeholder="¿Como podemos ayudarle?" wrap="hard"></textarea></div>
        <div class="field"><label for="Submit"></label><input id="Submit" value="Envíenos su consulta" name="Submit" type="submit"></div>
    </div>
</div>

</form></div></div>

0 个答案:

没有答案