Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Verification

Script for the verification of the fields of a form before sending the e-mail.


<%
Function CheckMail(strMail)
if len(strMail)>6 then
  pos = Instr(1,strMail, "@")
if pos >= len(strMail)-3 then
  Exit Function
end if
if pos < 2 then
  Exit Function
end if
dotpos = Instr(pos+1 ,strMail, ".")
if dotpos > len(strMail)-2 then
  Exit Function
end if
if len( Mid(strMail, pos+1) ) < 5 or dotpos = 0 then
  Exit Function
end if
CheckMail = True
else
  CheckMail = False
end if
End function

blnMail = CBool(checkMail("test@aspitalia"))
if blnMail = True then
  Response.write "<p>E-mail valida"
else
  Response.write "<p>E-mail non valida"
end if
%>


Download code...


Print this page


 

Inizio pagina

risorse per webmaster