Skip to main content

PHP: email validation form 1212 Responses

Last post: 2 years, 2 months ago | Thread started: Aug 1, 06, 7:01 a.m.

RespondNew TopicDisable Images

  • fifty50

    I've got this PHP email validation form on my site:

    http://curtis.nexteradesign.com/…

    That's basically the meat of it. For some reason, though, some valid email addresses get returned as being invalid. For example "anybody@sheppard.de" or "anybody@ideen-reich.com" come back as being invalid, even though the domains are in fact valid. Help?

    Aug 1, 06, 7:01 a.m. – Permalink
  • UndoUndo

    you got mail!

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:13 a.m. – Permalink
  • ldww

    i see you are using getmxrr. why not try the example in the comments? they do it a bit differently then you.

    http://us2.php.net/getmxrr

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:13 a.m. – Permalink
  • fifty50

    thanks guys i'll give them both a shot and see what happens.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:41 a.m. – Permalink
  • kinetic

    this function has always served me well:

    function check_email($email) {
    if(eregi("^[a-z0-9\._-]+@+[a-z0… $email)) {
    return TRUE;
    } else {
    return FALSE;
    }
    }

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:47 a.m. – Permalink
  • ldww

    kinetic, that is just a regex. he wants to check the hostname to see if it is a valid host rather then whatevernameusertypes.com. reg ex will just see if it looks right, not valid.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:48 a.m. – Permalink
  • fifty50

    Ed Zachary what ldww said

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:54 a.m. – Permalink
  • UndoUndo

    curtis what I sent to you will check that the email address 'looks right' not that it has valid mail exchange records, you might want to add that from yr other function

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 7:58 a.m. – Permalink
  • fifty50

    oh feck. that was the original problem. what I had was validating most emails but my buddy tried it with his and it came back as invalid!

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 8 a.m. – Permalink
  • kinetic

    sorry mate...should have read your post

    im always doing that ;)

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 8:13 a.m. – Permalink
  • ldww

    as a sidenote, i have never actually checked the hostname. i think most people are content with making sure the email looks right.

    if you are very concerned about a vlid email address just require email confirmation by sending them an email with some kind of keycode.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 8:16 a.m. – Permalink
  • UndoUndo

    this will validate emails in the correct format

    ie. use@domani.extension

    will validate

    but
    john&john@somedomain.$uper

    wont

    but will not check that the domain has a valid mail exchange record. sorry for the confusion

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 8:16 a.m. – Permalink
  • UndoUndo

    I agree with ldww, checking mail exchange records isnt that robust just make sure they validate the email with an activation code,

    I could submit yr email address and it will validate with MX record but its not mine, so activation through email is more reliable IMO

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earAug 1, 06, 8:23 a.m. – Permalink

Login or Register to respond to this

Skip to main content