Announcement

Collapse
No announcement yet.

Email Validator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tommy Boy
    replied
    Thanks Bob!

    However, your code seems to be too generous, as it accepts "[email protected]", which is obviously an illegal address.

    I found how to fix my old code though:
    PHP Code:
    eregi ("^[0-9a-z_]([-.]?[0-9a-z_])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$"$email
    This accepts _ in the beginning and end of the username part of the address. It also supports 4 letters domain names, such as ".info". I hope it helps others as well.

    Thanks again!
    Last edited by Tommy Boy; Tue 6 Nov '01, 1:13am.

    Leave a comment:


  • Bob Day
    replied
    Check the attachment! I don't het it displait correct in the forum.

    Gives TRUE when it's a valid email, it the best email validator code I've seen.

    Leave a comment:


  • Tommy Boy
    started a topic Email Validator

    Email Validator

    I am currently using this email validator code:

    PHP Code:
    eregi ("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$"$email
    However, it does not accept emails in the format "[email protected]", although they are legal.

    Can anyone help me fix it?
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X