obrigado um abraço a todos

Posted 02/08/2004, 14:39
Posted 02/08/2004, 15:22
<Table width="166" cellspacing=0 cellpading=0> <tr> <form method="POST" action="../news/cod.asp"> <td width="43" height="39" valign="top"> <span class="style2">E-mail</span> : </td> <td valign="top"> <input name="mail" MaxLength="50" type="text" id="mail" style="font-family : Verdana; font-size : 10px; background : White; border : 1px solid #000000; color : Black; width : 80px;"> <input name="imagem" type="image" src="../../imgs/ok.gif" alt="OK" align="middle"> </p> </td> <tr> <td height="4"></td> <td width="113"></td> </tr> </form> </table>
<!--#include file="../connect/connectar.asp" --> <title>Muito Obrigado</title><center> <% nome=request.form("nome") mail=Request.Form("mail") %> <% 'FUNÇÃO QUE VALIDA O EMAIL Function Valida_Email(strEmail) Dim bIsValid bIsValid = True If Len(strEmail) < 5 Then bIsValid = False Else If Instr(1, strEmail, " ") <> 0 Then bIsValid = False Else If InStr(1, strEmail, "@", 1) < 2 Then bIsValid = False Else If InStrRev(strEmail, ".") < InStr(1, strEmail, "@", 1) + 2 Then bIsValid = False End If End If End If End If Valida_Email = bIsValid End Function %> <% if Valida_Email(mail) = true then response.write "Muito Obrigado, " else response.write "Você precisa digitar um e-mail válido para cadastro" response.end end if %> <% Sql = "SELECT email FROM news WHERE email = '" & Request.form("mail") & "'" set Rs = DB.Execute(Sql) If not Rs.Eof then Response.write("Seu e-mail encontra-se cadastrados em nossos banco!") response.end else 'insere os dados end if %> <% If (mail = "") then Response.write("Você deve digitar um e-mail para se cadastrar") Else set rs = DB.execute("INSERT INTO news (email,nome) Values('"&mail&"','"&nome&"')") Response.write("E-mail adicionado com sucesso.") End if %>
Posted 05/08/2004, 14:08
Edição feita por: Allan, 05/08/2004, 14:10.
Posted 05/08/2004, 14:18
Posted 06/08/2004, 11:38
Posted 06/08/2004, 14:26
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)