Form não funciona no Mozilla e IE
Gente, não tenho experiencia com PHP, só HTML.
Estou fazendo um formulário de contato. Como não mexo com PHP, baixei o código PHP e adaptei.
Tudo está funcionando perfeitamente no Chrome, mas no Mozilla e IE não funciona. Quando clico em "enviar", não recebo a confirmação, a página só recarrega, e o email nunca chega. Alguem poderia me ajuda por favor?
Segue o código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="[http://www.w3.org/1999/xhtml">](http://www.w3.org/1999/xhtml%22)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>General Transmission</title>
<script type="text/javascript">
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a*)&&x.oSrc;i++) x.src=x.oSrc;*
}
*function MM_preloadImages() { //v3.0*
* var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();*var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
* if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms**[n];*
* for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers**.document);*
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
* if ((x=MM_findObj(a**))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}*
}
*</script>*
*<style type="text/css">*.Catalogos {
font-size: 18px;
font-family: Verdana, Geneva, sans-serif;
color: #333;
}
.Titulo {
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
font-size: 24px;
color: #f7941e;
text-align: left;
}
.Contato {
color: #f7941e;
text-align: right;
font-family: Verdana, Geneva, sans-serif;
font-weight: bold;
}
.Telefone {
font-size: 24px;
}
a:link {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #f7941e;
text-decoration: none;
}
a:hover {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #f7941e;
text-decoration: underline;
}
Form {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #333;
text-decoration: none;
font-weight: bold;
}
textarea {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #333;
text-decoration: none;
width: 455px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-position: -200px;
background-color: #f0f3ed;
resize: none;
outline: none;
height: 180px;
overflow:auto;
}
input[type=text] {
font-family: Verdana, Geneva, sans-serif;
font-size: 14px;
color: #333;
text-decoration: none;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #f0f3ed;
outline: none;
width: 455px;
}
p {
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
}
p {
margin-top: 1px;
margin-bottom: 15px;
}
</style>
<style type="text/css">
body {
margin:0;
}
</style>
</head>
<body background="fundo.jpg" marginwidth="0" marginheight="0" onload="MM_preloadImages('bot_produtos_up.png','bot_contato_up.png','logo_up.png','bot_visualizar_up.png','bot_catalogos_up.png','enviar_up.png')">
*<?php*
*if (isset($_POST['BTEnvia'])){*//Variaveis de POST, Alterar somente se necessário
//====================================================
*$nome = $_POST['nome'];*
*$email = $_POST['email'];*
*$telefone = $_POST['telefone'];*
*$assunto = $_POST['assunto'];*
* ** **$mensagem = $_POST['mensagem'];*
//====================================================
//REMETENTE --> ESTE EMAIL TEM QUE SER VALIDO DO DOMINIO
//====================================================
$email_remetente = $email; // deve ser um email do dominio
//====================================================
//Configurações do email, ajustar conforme necessidade
//====================================================
$email_destinatario = "mdc4@terra.com.br"; // qualquer email pode receber os dados
$email_reply = $email;
$email_assunto = "Contato pelo site General Transmission: $assunto";
//====================================================
//Monta o Corpo da Mensagem
//====================================================
$email_conteudo .= "Nome: $nome \n";
$email_conteudo .= "Email: $email \n";
$email_conteudo .= "Telefone: $telefone \n";
$email_conteudo .= "Assunto: $assunto \n";
$email_conteudo .= "Mensagem: $mensagem \n";
//====================================================
//Seta os Headers (Alerar somente caso necessario)
//====================================================
$email_headers = implode ( "\n",array ( "From: $email_remetente", "Reply-To: $email_reply", "Subject: $email_assunto","Return-Path: $email_remetente","MIME-Version: 1.0","X-Priority: 3","Content-Type: text/html; charset=UTF-8" ) );
//====================================================
//Enviando o email
//====================================================
if (mail ($email_destinatario, $email_assunto, nl2br($email_conteudo), $email_headers)){
$sucesso = "Mensagem enviada com sucesso! <br> Em breve, entraremos em contato. Obrigado.";
}
else{
$sucesso = "Falha no envio. <br> Por favor, tente novamente ou entre em contato via Email ou Telefone. Obrigado.";
}
//====================================================
*}** *
?>
<!-- INICIO CABECALHO -->
*<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="162" >*
*<tr>*
*<td width="30%" >*<!-- INICIO LATERAL EXPANDIDA ESQUERDA -->
*<table height="162" width="100%" cellpadding="0" cellspacing="0" border="0">*
*<tr>*
*<td></td>*
*</tr>**<tr bgcolor="acacac" height="3">*
*<td></td>*
*</tr>**<tr>*
*<td height="117" bgcolor="f0f3ed"></td>** </td>*
*</tr>*
*</table>*<!-- FIM LATERAL EXPANDIDA ESQUERDA -->
*</td>*
*<td>*
*<center>*<!-- INICIO CONTEUDO CABEÇALHO -->
*<table height="162" cellpadding="0" cellspacing="0" border="0">*
*<tr>*
*<td width="217" height="162">*
<!-- INICIO LOGO -->
*<table width="482" height="162" border="0" cellpadding="0" cellspacing="0">*
*<tr>*
*<td width="331" height="42"></td>*
*</tr>*
*<tr>*
*<td bgcolor="acacac" height="3"></td>*
*</tr>*
*<tr>*
*<td height="117" bgcolor="f0f3ed">*
* <a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','logo_up.png',1)"><img src="logo.png" alt="Home" width="304" height="117" id="Home" /></a>*
* </td>*
*</tr>*
*</table>*
<!-- FIM LOGO -->
</td>
* <td width="201">*
* <img src="detalhe_menu.png" width="201" height="162" />*
* </td>*
<td width="445">
<!-- INICIO BOTOES -->
*<table height="84" cellpadding="0" cellspacing="0" border="0">*
*<tr height="84">*
*<td></td>*
* <td></td>*
*<td></td>*
*</tr>*
*<tr bgcolor="acacac" height="3">*
*<td></td>*
* <td></td>*
* <td></td>*
*</tr>*
*<tr>*
*<td height="75" bgcolor="f0f3ed">*
* <a href="produtos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Produtos','','bot_produtos_up.png',1)"><img src="bot_produtos.png" width="131" height="75" id="Produtos" /></a> *
* </td>*
*<td height="75" bgcolor="f0f3ed">*
* <a href="catalogos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Catalogos','','bot_catalogos_up.png',1)"><img src="bot_catalogos.png" width="132" height="75" id="Catalogos" /></a>*
* </td>*
* <td height="75" bgcolor="f0f3ed">*
* <img src="bot_contato_up.png" width="107" height="75" alt="Contato" /></td>*
*</tr>*
*</table>*
<!-- FIM BOTOES -->
*</td>*
* </tr>*
* </table>*
<!-- FIM CONTEUDO CABEÇALHO -->
*</center>*
*</td>*
*<td width="30%">*
<!-- INICIO LATERAL EXPANDIDA DIREITA -->
*<table height="84" width="100%" cellpadding="0" cellspacing="0" border="0">*
*<tr height="84">*
*<td></td>*
*</tr>*
*<tr bgcolor="acacac" height="3">*
*<td></td>*
*</tr>*
*<tr>*
*<td height="75" bgcolor="f0f3ed"></td>*
* </td>*
*</tr>*
*</table>*
<!-- FIM LATERAL EXPANDIDA DIREITA -->
*</td>*
*</tr>*
*</table>*
*<table height="28" width="100%" cellpadding="0" cellspacing="0" border="0" background="fundo3.jpg">*
*<tr><td>*
*</td></tr>*
*</table>*
<!-- FIM CABECALHO -->
<!-- INICIO CONTEUDO -->
*<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="80" bgcolor="white">*
*<tr>*
*<td width="23%"></td>*
*<td><center>*
*<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="white">*
*<tr>*
*<td colspan="2" align="left" class="Titulo"><p>PEÇA SEU ORÇAMENTO</p></td>*
*</tr>*
* <tr>*
* <td height="545"><form name="form1" id="form1" action="<? $PHP_SELF; ?>" method="POST">*
* <table width="620" height="551" border="0" cellpadding="0" cellspacing="0" background="fundo_form.png" style= "background-repeat: no-repeat">*
* <tr height="4">*
* <td height="17" valign="top"> </td>*
* <td valign="top"> </td>*
* </tr>*
<!--INICIO NOME-->
* <tr height="40">*
* <td width="127" height="53" valign="top"><label for="nome"></label> Nome </td>*
* <td width="493" valign="top"><input type="text" size="55" name="nome"></td>*
* </tr>*
<!--FIM NOME-->
<!--INICIO EMAIL-->
* <tr height="40">*
* <td width="127" height="53" valign="top"> Email </td>*
* <td width="493" valign="top"><input type="text" size="55" name="email"></td>*
* </tr>*
<!--FIM EMAIL-->
<!--INICIO TEL-->
* <tr height="40">*
* <td width="127" height="52" valign="top"> Telefone </td>*
* <td width="493" valign="top"><input name="telefone" type="text" size="50"></td>*
* </tr>*
<!--FIM TEL-->
<!--INICIO ASSUNTO-->
* <tr height="40">*
* <td width="127" height="59" valign="top"> Assunto</td>*
* <td width="493" valign="top">*
* <input name="assunto" type="text" size="55">*
* </td>*
* </tr>*
<!--FIM ASSUNTO-->
<!--INICIO MSG-->
* <tr >*
* <td width="127" height="211" valign="top"><label for="mensagem"></label> Mensagem </td>*
* <td width="493" valign="top"><textarea name="mensagem" id="mensagem" cols="62" rows="11"></textarea></td>*
* </tr>*
<!--FIM MSG-->
<!--INICIO BOTÃO ENVIAR-->
* <tr>*
* <td height="53" align="right" valign="top"> </td>*
* <td align="right" valign="top">*
* <a onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Teste','','enviar_up.png',1)"><input type="image" src="enviar.png" name="BTEnvia" value="Enviar2" id="Teste"></a>*
* </td>*
* </tr>*
* <tr>*
* <td align="center" valign="top" colspan="2">*
<?php
echo "$sucesso";
*?>*
*</td>*
* </tr>*
<!--FIM BOTÃO ENVIAR-->
* </table>*
* </form>*
* </td>*
* <td width="270" valign="top" class="Contato"><p>11 <span class="Telefone">4807-0092</span><br>*
* 11 <span class="Telefone">97277-4142</span><br><br>*
* <a href="mailto:jrn@generalt.com.br">jrn@generalt.com.br</a><br>*
* <a href="mailto:vendas@generalt.com.br">vendas@generalt.com.br</a></p>*
* <hr align="right" width="230" size="2" color="#f7941e" class="Titulo">*
* <p>Rua Várzea Paulista, 362<br>*
* Vl. Progresso - Jundiaí/SP</p>*
* <br />*
<!--INICIO GOOGLE MAPS-->
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3667.0551279144083!2d-46.86821398453433!3d-23.204661484861198!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x94cf26d5ae2a5743%3A0x3d2404a9239b589!2sR.+V%C3%A1rzea+Paulista%2C+362+-+Vila+Agricola%2C+Jundia%C3%AD+-+SP%2C+13202-700!5e0!3m2!1spt-BR!2sbr!4v1480521917852" width="233" height="265" frameborder="0" style="border:1px solid #f7941e" allowfullscreen></iframe>
<!--FIM GOOGLE MAPS-->
* </td>*
* </tr>*
* </table>*</center></td>
*<td width="23%"></td>*
*</tr>*
*</table>*<!-- FIM CONTEUDO -->
</td></tr>
<tr><td>
<!-- INICIO RODAPE -->
*<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="84" >*
*<tr>*
*<td width="30%" background="rodape_fundo1.png"></td>**<td>*
*<center>*
*<img src="rodape.png" alt="Rodape" width="1176" height="84" usemap="#Map" border="0" />*
*</center>*
*</td>*<td width="30%" background="rodape_fundo2.png"></td>
*</tr>*
*</table>*<!-- FIM RODAPE -->
*</td></tr>*
*</table>**<map name="Map" id="Map">*
* <area shape="rect" coords="1010,18,1072,47" href="mailto:jcarrero@mdc4.com.br" />*
*</map>*
*</body>**</body>*
*</html>*Discussão (7)
Carregando comentários...