NetworkClue.com
NetworkClue Home PageHome Contact UsContact ConsultingConsult
Bulletin Board
Internet Services covers Secrets to hosting websites, Hosting your own web server, and using DNS Servers.Operating Systems leads you through the decision of Linux vs. Windows, ideal installations and setups to create an efficient and redundant environment for your business, and great features to make management easier.Routing & Firewalls contains articles that will allow you to take control of your router. Learn how to protect your company with access lists and advanced firewall techniques.Hardware answers the common questions about Switches vs. Hubs, recommends SysAdmin Tools, and recommendations for adequate power protection.Utilities will cover fighting spam, using Anti-Virus programs effectively and the must haves for every administrator's software toolbox.

Bulletin Board

ASP E-Mail Validation

<html>
<head>
<title>VBscript email validation</title>
</head>

<body>

<%
Dim emailAddress
emailAddress=Request("emailAddress")
if emailAddress <> "" then
  emailAddress= Cstr(emailAddress)
  if emailAddress <> "" then
    blnValidEmail=RegExpTest(emailAddress)
    if blnValidEmail then
      Response.Write("Valid email address")
    else
      Response.Write("Not a valid email address")
    end if
  end if

Function RegExpTest(sEmail)
  RegExpTest=false
  Dim regEx, retVal
  Set regEx=New RegExp

  ' Create regular expression:
  regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"

  ' Set pattern:
  regEx.IgnoreCase= true

  ' Set case sensitivity.
  retVal=regEx.Test(sEmail)

  ' Execute the search test.
  If not retVal Then
    exit function
  End If

  RegExpTest=true
End Function
Else
%>

<form action="emailCheck.asp" method="post">
  <input type="text" name="emailAddress">
  <input type="submit" value="submit">
</form>

<%End If %>

</body>
</html>

Article last reviewed: 09/28/2004


del.icio.us

Created by: Digital Foundation, inc.

Copyright © 2002-2005 Digital Foundation, inc.   www.networkclue.com

All content of the NetworkClue website is copyrighted. Articles, notes, outlines, and all other materials may not be stored on the Internet or sold or placed by themselves or with other material in any electronic or printed format in whole or part. However materials may be referenced by links to the site.

 

Related Articles:
Handy HTML
Website Best Practices

 

Advertise Here