Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    21

    Unanswered: email verification

    what would be the best way to set up email verification?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    verify what.. that the email format is legit, or that the email actually exists

    for the former use a regular expression mask
    bearing in mind that an email address can take the form of alphanumeric characters a-z0-9, with leading and trailing full stops
    eg my.username@my.host.name.TLD

    the number of fullstops is discretional, ie it could be my.full.qualified.hostname.TLD or it could be just hostname.TLD

    there are some examples on the web

    one of the potential gotchas is that some emal servics also allow th ' character eg o'hagan, o'halloran
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2008
    Posts
    10

    How I do emails:

    I ripped this code from my user registration form at avsbest.com.. hope this helps.

    This is how I do email varification:

    PHP Code:
    <?php 
    //If email field is completly empty:
            
    if(strlen($email)<1) {
            print 
    "&bull; No Email Address entered.<br>";
            }
            
    //If email field is not empty, continue to check if it's fake:
            
    else {
            
    //Email Varification Checker:        
    // take a given email address and split it into the  username and domain. 
    list($mailName$mailDomain) = split("@"$email); 
    if (
    checkdnsrr($mailDomain"MX")) { 
     
    $validEmail="Yes!"

    else { 
     print 
    "&bull; Email Address is not valid.<br>";

    }
    ?>
    First I check if the user even entered the damn thing.
    Second, I make sure the email is in proper format (e.g: user@domain.EXT) Third, that the domain name exists.
    If all goes right, then I make $validEmail="anything" (I put Yes!)

    Later on down the form, I just check if $validEmail has more then 0 characters.
    PHP Code:
    if(strlen($validEmail)>0) {... 

    // submit data or do whatever you want to do.

    ..} 

  4. #4
    Join Date
    Jul 2008
    Posts
    13
    I'm web programmer. your coding is best . thanks to share this coding . this is too much helpful for us.

  5. #5
    Join Date
    Apr 2007
    Posts
    24
    I am using following code and it works for me....


    if(strlen($Email_add()) && !preg_match ("/^[\w\.-]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]+$/", $Email_add))
    {
    print "Email Address is not valid";
    }

Posting Permissions

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