Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Boa tarde pessoal, estou querendo fazer uma página em que uma pessoa indique para outras 5, assim:
Ela entra numa pagina e digita 5 nomes, 5 emails e 5 telefones de pessoas que ela quer indicar.
Queria gravar em banco esses registros deixando como parâmetro o indicador numa combobox antes de digitar todos esses dados.
Exemplo na imagem abaixo:
/applications/core/interface/imageproxy/imageproxy.php?img=http://img.photobucket.com/albums/v328/mows/indicador.jpg&key=15c4f00ce7ff8b26f36df706ffdb3f72027f0ecc1ecfe2914ac3f29125c73886" alt="Imagem Postada" />
Como eu faço para gerar esses registros?!
Talvez eu tenha que usar um for para cada registro, mas não sei como usar.
Alguém poderia me ajudar?!
Agradeço.
To tentando fazer com o código a seguir:
<%
if Request.Form("Action") = "Enviar" then
if Request("txtnome1") = "" and Request("txtnome2") = "" and Request("txtnome3") = "" and Request("txtnome4") = "" and Request("txtnome5") = "" then
%>
<script language="javascript">
<!--
window.alert ("Digite ao menos um nome para indicação.");
history.back();
//-->
</script>
<%
if Request("txtEmail1") = "" and Request("txtEmail2") = "" and Request("txtEmail3") = "" and Request("txtEmail4") = "" and Request("txtEmail5") = "" then
%>
<script language="javascript">
<!--
window.alert ("Digite ao menos um email válido para indicação.");
history.back();
//-->
</script>
<%
else
Set rsIndicado = Server.CreateObject("ADODB.Recordset")
strSql = " execute indicacao.dbo.spInsIndicado "&Request("cboIn")&", "&strNome&", "&strEmail&", "&strFome&""
set rsIndicado = ConSql.Execute(strSql)
strHTML = strHTML & "<table border=0 cellspacing=2 cellpadding=2 width=""100%"">" & chr(13) & chr(10)
strHTML = strHTML & "<tr><td height=20></td></tr>" & chr(13) & chr(10)
strHTML = strHTML & "<tr><td align=left><font face=arial><STRONG>"&Request("txtnome")&"</STRONG></font><BR><BR></td></tr>" & chr(13) & chr(10)
strHTML = strHTML & "<tr><td align=left><font face=arial>Email: "&Request("txtEmail")&"</font><BR><BR></td></tr>" & chr(13) & chr(10)
strHTML = strHTML & "<tr><td align=left><font face=arial>Mensagem: "&Request("txtMsg")&"</font><BR><BR></td></tr>" & chr(13) & chr(10)
strHTML = strHTML & "</table>" & chr(13) & chr(10)
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = ""
Mail.FromName = Request("txtNome")
Mail.From = request("txtEmail")
Mail.AddAddress ""
Mail.AddBCC ""
Mail.Subject = ""
Mail.IsHTML = True
Mail.Body = "<HTML><BODY><CENTER>" & strHTML & "</CENTER></BODY></HTML>"
On Error Resume Next
Mail.Send
If Err <> 0 Then
%>
<script language="javascript">
<!--
window.alert ("Erro ao tentar enviar email. Por favor tente novamente mais tarde.");
history.back();
//-->
</script>
<%
Else
If Err = 0 Then
Response.Redirect("indica.asp?status=env")
end if
End If
End If
end if
%>
<link rel="stylesheet" link="text/css" href="css/style.css">
<body>
<div id="wrapper" class="encadre">
<div class="tl"></div>
<div class="tr"></div>
<div id="header">
</div> <!--header ends-->
<div id="headerlogo">
</div>
<div id="banner">
</div>
<div id="navigation">
<ul>
<li class="home active"><a href="" >Home</a></li>
<li><a href="">Equipe</a></li>
<li><a href="">Sistema de Jobs</a></li>
</ul>
</div> <!--navigation ends-->
<div id="content" class="encadre">
<div class="bl"></div>
<div class="br"></div>
<div id="left_column">
<div id="tab-content-post">
<div class="home-post">
<ul>
<form name="form" method="post" action="">
<div id="indicador">
<h1>Indicador</h1>
<p>
Selecione seu nome
</p>
<select name="cboCidade" class="PadraoSelect1" value="<%=Request("cboCidade")%>">
<option selected value="0">Selecione...</option>
<%
Set rsComunidade = Server.CreateObject("ADODB.Recordset")
strSql = " execute indicacao.dbo.spSelComunidade"
set rsComunidade = ConSql.Execute(strSql)
if not rsComunidade.EOF then
while not rsComunidade.EOF
Response.Write("<OPTION VALUE="&rsComunidade("chaveindicador")&">"&rsComunidade("nome")&"</OPTION>")
rsComunidade.MoveNext
wend
end if
%>
</select>
<BR /><BR /> <BR /><BR />
<h1>Indicados</h1>
<p>Digite os nomes e emails de quem deseja indicar</p>
<table width="100%" border="0" cellspacing="3" cellpadding="3" class="tableemails">
<tr>
<td width="30">Nome</td><td><input name="txtNome1" class="input" type="text" /></td>
</tr>
<tr>
<td>Email</td><td><input name="txtEmail1" class="input" type="text" /></td>
</tr>
<tr>
<td>Telefone</td><td><input name="txtTel1" class="input-tel" type="text" id="phone1" /></td>
</tr>
<tr><Td height=20></Td></tr>
<tr>
<td>Nome</td><td><input name="txtNome2" class="input" type="text" /></td>
</tr>
<tr>
<td>Email</td><td><input name="txtEmail2" class="input" type="text" /></td>
</tr>
<tr>
<td>Telefone</td><td><input name="txtTel2" class="input-tel" type="text" id="phone2" /></td>
</tr>
<tr><Td height=20></Td></tr>
<tr>
<td>Nome</td><td><input name="txtNome3" class="input" type="text" /></td>
</tr>
<tr>
<td>Email</td><td><input name="txtEmail3" class="input" type="text" /></td>
</tr>
<tr>
<td>Telefone</td><td><input name="txtTel3" class="input-tel" type="text" id="phone3" /></td>
</tr>
<tr><Td height=20></Td></tr>
<tr>
<td>Nome</td><td><input name="txtNome4" class="input" type="text" /></td>
</tr>
<tr>
<td>Email</td><td><input name="txtEmail4" class="input" type="text" /></td>
</tr>
<tr>
<td>Telefone</td><td><input name="txtTel4" class="input-tel" type="text" id="phone4" /></td>
</tr>
<tr><Td height=20></Td></tr>
<tr>
<td>Nome</td><td><input name="txtNome5" class="input" type="text" /></td>
</tr>
<tr>
<td>Email</td><td><input name="txtEmail5" class="input" type="text" /></td>
</tr>
<tr>
<td>Telefone</td><td><input name="txtTel5" class="input-tel" type="text" id="phone5" /></td>
</tr>
</table>
<BR /><BR /><BR />
<input name="Action" type="submit" value="Enviar" class="botao" />
<BR /><BR />
</div>
</form>
</li>
</ul>
</div>
</div>
</div>
</body>Carregando comentários...