Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Lucas Röhers

Formularário de contato

Recommended Posts

Olá, eu to iniciando minha jornada no PHP, criei um formulário de contato e falta dar a função de enviar para o e-mail página de confirmação essas coisas..

 

O problema é que sou muito leigo ainda no php, como eu posso fazer funcionar o meu formulário de contato ?

 

Codigo HTML

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
 <meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
 <title>teste</title>
</head>
<body>
<form method="post"
action="mailto:shadowwarfantasy@yahoo.com.br" name="form1">
 <hr style="width: 100%; height: 2px;">
 <table style="text-align: left; width: 412px; height: 92px;"
border="0" cellpadding="2" cellspacing="2">
   <tbody>
     <tr>
       <td><input alt="" src="Logotipo%20%282%29.jpg"
value="" height="69" type="image" width="200"></td>
       <td style="text-align: left; white-space: nowrap;"> <span
style="font-weight: bold;">Telefone: (51) 3066.5512</span>
       </td>
     </tr>
   </tbody>
 </table>
 <br>
 <table style="text-align: left; width: 371px; height: 54px;"
border="0" cellpadding="2" cellspacing="2">
   <tbody>
     <tr>
       <td style="white-space: nowrap;"><span
style="font-weight: bold;">*Seu Nome:<br>
       </span><span style="font-weight: bold;"><input
name="nome"><br>
       </span></td>
       <td style="white-space: nowrap;">
       <div style="text-align: left;"><span
style="font-weight: bold;"> Empresa:</span></div>
       <span style="font-weight: bold;"><input
name="empresa"><br>
       </span></td>
     </tr>
   </tbody>
 </table>
 <span style="font-weight: bold;"></span><span
style="font-weight: bold;"></span>
 <table style="text-align: left; width: 371px; height: 54px;"
border="0" cellpadding="2" cellspacing="2">
   <tbody>
     <tr>
       <td style="white-space: nowrap;"><span
style="font-weight: bold;"> *Email:<br>
       <input name="email"></span></td>
       <td><span style="font-weight: bold;">*Assunto:</span><br>
       <input name="assunto"></td>
     </tr>
   </tbody>
 </table>
 <span style="font-weight: bold;"></span>
 <table style="text-align: left; width: 371px; height: 54px;"
border="0" cellpadding="2" cellspacing="2">
   <tbody>
     <tr>
       <td><span style="font-weight: bold;"> Telefone:</span><br>
       <input name="telefone"></td>
       <td style="white-space: nowrap;"><span
style="font-weight: bold;"> Celular:</span><br>
       <input name="celular"></td>
     </tr>
   </tbody>
 </table>
 <span style="font-weight: bold;"></span><span
style="font-weight: bold;"></span><span
style="font-weight: bold;">*Menssagem:</span><br>
 <textarea wrap="off" cols="30" rows="4"
name="Menssagem"></textarea><br clear="all">
 <br>
 <input name="Envie um Arquivo" type="file"><br>
 <br>
 <input name="Enviar" value="Enviar" type="submit"><input
name="Limpar" value="Limpar" type="reset"><br>
 <br>
 <fieldset><legend style="font-weight: bold;">Posithive
Representações</legend><span
style="font-weight: bold;">A Posithive
agradeçe seu contato, e estará lhe
atendendo em breve.</span><br>
 </fieldset>
 <br>
 <hr style="width: 100%; height: 2px;"></form>
</body>
</html>

 

eu declarei mailto: mas não quero que abra o e-mail, e sim que mande direto da página..

 

eu sei que tens que fazer um arquivo php, e que também deve se ter os arquivo .htaccess e o php.ini, eu coloquei estes arquivo no meu servidor na pasta public_html.

 

Então alguém ai me ajuda a por as funções neste formulário ? ^^

 

o que ue preciso é o código php para esse html que fiz, e como instala-lo que nunca instalei um php nos servidores!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Lucas Röhers,

Mude o seu <form> para

<form method="post" action="enviar.php" name="form1">

 

Enviar.php

<?php
// O remetente deve ser um e-mail do seu domínio conforme determina a RFC 822.
// O return-path deve ser ser o mesmo e-mail do remetente.
$headers = "MIME-Version: 1.1\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: eu@seudominio.com\r\n"; // remetente
$headers .= "Return-Path: eu@seudominio.com\r\n"; // return-path
$envio = mail("shadowwarfantasy@yahoo.com.br", "Assunto", "Texto", $headers);

if($envio)
echo "Mensagem enviada com sucesso";
else
echo "A mensagem não pode ser enviada";
?>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.