Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email Validation

    I was wondering if anyone knows of a good server side email validation useing asp that does all the normal checks i.e. @ the .com but also checks when people put something like email@email.com where the first word is the same as the second word? another example is word@word.com

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    http://regexlib.com/REDetails.aspx?regexp_id=284

    This regular expression would work pretty good. I can build it into a function if you are unfamiliar with regexp.

    As for making sure the mailbox and the domain aren't the same, I think writing a thing in asp would be the easiest.

    You could do something like:

    Code:
    <%
    Function SameMail_Domain(strAddress)
    	Dim aryMail
    	aryMail=Split(strAddress, "@")
    	If aryMail(0)=Mid(aryMail(1),1,InstrRev(aryMail(1),".")-1) Then
    		SameMail_Domain=True
    	Else
    		SameMail_Domain=False
    	End If
    End Function
    %>
    
    <% If SameMail_Domain("blah@blah.com") Then %>
    	<p>The e-mail is the same!</p>
    <% End If %>
    OracleGuy

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    I think this is Whammys stuff, but it really shows off regular expressions really well.

    http://www.solidscripts.com/downloads/functions.txt

    (This is whammys stuff, I only post it as a matter of reference)
    Whats the point of a signature?

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    51° 03' -78" N -114° 05' 72" W
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thankyou both for the information, I am sure wammy wont mind very helpfull for sure!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •