I have the following code, where when I finish filling out the form I want to receive an email with confirmation of the data and later open a page where I will redirect:
However, after the code that I present I have some difficulties in finishing;
Can you help?
<h2><td><font color ="#336699"> Formulario</td></font></h2>
<form action="http://www.teste.com/" id="ContactUsCaptchaWebForm" method="post" onsubmit="return ValidateForm(this);" target="_top">
<input name="skip_WhereToSend" type="hidden" value="[email protected]"/>
<input name="skip_SnapHostID" type="hidden" value="D2YEXZTGA4Q2" />
<input name="skip_WhereToReturn" type="hidden" value="http://www.torangis.com/" />
<input name="skip_Subject" type="hidden" value="Contact Us Form" />
<input name="skip_ShowUsersIp" type="hidden" value="1" />
<input name="skip_SendCopyToUser" type="hidden" value="1" />
<script type="text/javascript">
function ValidateForm(frm) {
if (frm.Name.value == "") {alert('Nome é requerido');frm.Name.focus();return false;}
if (frm.Email.value == "") {alert('É necessário preencher os campos obrigatórios');frm.Email.focus();return false;}
if (frm.Email.value.indexOf("@") < 1 || frm.Email.value.indexOf(".") < 1) {alert('É necessário um endereço de e-mail válido');frm.Email.focus();return false;}
if (frm.Telemovel.value == "") {alert('É necessário preencher os campos obrigatórios');frm.Telemovel.focus();return false;}
if (frm.skip_CaptchaCode.value == "") {alert('É necessário preencher os campos obrigatórios');frm.skip_CaptchaCode.focus();return false;}
return true; }
function ReloadCaptchaImage(captchaImageId) {
var obj = document.getElementById(captchaImageId);
var src = '' + obj.src;
obj.src = '';
var date = new Date();
var pos = src.indexOf('&rad=');
if (pos >= 0) { src = src.substr(0, pos); }
obj.src = src + '&rad=' + date.getTime();
return false; }
</script>
<table border="0" cellpadding="5" cellspacing="0" width="600">
<tr>
<td><font face="Arial"><font color ="#000000"> Nome *</td></font>
<td><input name="Name" type="text" maxlength="60" style="width:350px;" /></td>
</tr><tr>
<td><font face="Arial"><font color ="#000000"> E-mail *</td></font>
<td><input name="Email" type="text" maxlength="60" style="width:350px;" /></td>
</tr><tr>
<td><font face="Arial"><font color ="#000000"> Empresa / Loja (Se aplicável) </td></font>
<td><input name="Empresa" type="text" maxlength="43" style="width:350px;" /></td>
</tr><tr>
<td><font face="Arial"><font color ="#000000"> Concelho </td></font>
<td><input name="Concelho" type="text" maxlength="60" style="width:350px;" /></td>
</tr><tr>
<td><font face="Arial"><font color ="#000000"> Telemóvel *</td></font>
<td><input name="Telemovel" type="text" maxlength="43" style="width:350px;" /></td>
</tr><tr>
<td><font face="Arial"><font color ="#000000"> Mensagem opcional </td></font>
<td><textarea name="Comentario" rows="4" cols="50" style="width:350px;"></textarea></td>
</tr><tr>
<td colspan="2" align="center"> <br />
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" style="padding-bottom:18px;">
<tr valign="top"><td> <b><font face="Arial"><font size="2"><center>Inserir letras *</center></b>
<input name="skip_CaptchaCode" type="text" style="width:80px;" maxlength="6" />
</td><td>
<a href="http://www.teste.com/"><img id="CaptchaImage" alt="Contact Us form" title="HTML code for Contact Us form" style="margin-left:20px;" src="http://www.SnapHost.com/captcha/CaptchaImage.aspx?id=D2YEXZTGA4Q2&ImgType=2"/></a><br/><ahref="#" onclick="return ReloadCaptchaImage('CaptchaImage');"><span style="font-size:12px;"><font face="Arial">Renovar imagem</span></a> </td></tr>
</table> <br /><font face="Arial">
* Campos obrigatórios
<form enctype="text/plain" method="get" action="mailto:[email protected]">
<input type="submit" value="Enviar">
</form>
</td></tr>
</table><br />
</form>
<html>
<head>
<?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ;
$empresa = $_REQUEST['empresa'] ; $telefone = $_REQUEST['telefone'] ;
$concelho = $_REQUEST['concelho'] ; $message = $_REQUEST['message'] ;
mail( "[email protected]",
"Quero fazer activações através do teste da teste",
"#REVENDEDOR ################################################################
EMPRESA/LOJA:$empresa NOME:$name EMAIL: $email TELEFONE: $telefone
CONCELHO:$concelho MENSAGEM: $message ", "from: [email protected]");
header( "Location: http://teste.teste.com/resposta2.php" ); ?>
</head>
<body>
<br>
</body>
</html>
Thank you