Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Pessoal bom dia!
Estou com um pequeno problema: consegui arranjar um verificador de email para evitar que haja duplicação de um mesmo dado no BD, só que não tá dando certo. onde tem 'resp' eu quero que ele faça um resgate lá em baixo. Por ex: se der tudo ok, e ele mostra no <%=resp%> que "E-mail cadastrado com sucesso." se o email já existir, ele retorna "Este e-mail já está cadastrado."
Segue abaixo o code e valeu por quem puder ajudar :)
<!--#include file="conectar.asp"--><%AbreConexao'Recupero os dadosemail = replace(request.form("email"), "'", "''")'verifica se o email existestrSQL = "SELECT email FROM boletim_dados WHERE email='" & email & "'"Set oDados = RS.Execute(strSQL)If Not oDados.EOF Thenresp = "Este e-mail já está cadastrado."Elseresp = "E-mail cadastrado com sucesso."End IfoDados.CloseSet oDados = NothingRS.CloseSet RS = NothingIf email = "digite seu email" thenemail = "cadastro vazio"end ifinserir = "INSERT INTO boletim_dados (email) " & _"VALUES ('" & email & "')"Conexao.Execute(inserir)FechaConexao%><html><head><title>Boletim Informativo</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta HTTP-EQUIV="REFRESH" CONTENT="4; URL=boletim.htm'"><LINK href="../arquivos/style.css" type=text/css rel=stylesheet><script language="JavaScript" type="text/JavaScript"><!--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[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}//--></script></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('../arquivos/email.gif')"><table width="348" height="50" border="0" cellpadding="0" cellspacing="0"> <tr> <td background="../arquivos/email.gif"><table width="316" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20"> </td> <td width="225" class="branco"><strong><%=resp %></strong></td> <td width="45"> </td> </tr> </table> </td> </tr></table>Carregando comentários...