#1
  1. No Profile Picture
    houseman
    Guest
    Devshed Newbie (0 - 499 posts)
    Hey everyone, pretty new to PHP so I'll try not to be a lamer

    What I am trying to do is:

    I have a formmail that when submitted gets emailed to myself.

    Whomever is using the form is *supposed* to enter their email.

    What I want to do is - be able to check for specific criteria of the email. For example:

    That they have the proper format (i.e. '@') and make it so that they HAVE to enter their email in order to submit the form.

    Anyone have anyclues??

    Much appreciated.

    Thanks.

    Aaron
  2. #2
  3. No Profile Picture
    markdrayton
    Guest
    Devshed Newbie (0 - 499 posts)
    You can do this with JavaScript, which makes it a whole load easier than server-side scripting and stuff.
  4. #3
  5. No Profile Picture
    houseman
    Guest
    Devshed Newbie (0 - 499 posts)
    Nevermind people, I just figured it out
    Was so simple I feel dumb :P

    Seoncdly, if I WANTED to use Javascript I WOULD have. Hence the reason I posted in the PHP forum???
  6. #4
  7. No Profile Picture
    spaceman
    Guest
    Devshed Newbie (0 - 499 posts)
    Check out this page for at least two email-checking routines:

    http://www.phpwizard.net/tips/show.html?catID=2
  8. #5
  9. No Profile Picture
    spaceman
    Guest
    Devshed Newbie (0 - 499 posts)
    But having done a few tests, it looks like this function I've found from somewhere is pretty solid. If anyone has a more accurate/efficient better one, let me know. I guess anyone writing such code must have a good knowledge of exactly what does and doesn't consitute a valid, internationally recognised, email address. I mean, what if someone tries to enter non-English characters? Maybe if someone in China (for example) wants to join a mailing list with this function verifying their email address, they'll be denied. Can anyone else illuminate?

    function email_check ($address) {
    if (!eregi("^[^@[:space:]]+@([[:alnum:]-]+.)+[[:alnum:]][[:alnum:]][[:alnum:]]?$", $address)) {
    return FALSE;
    } else {
    return TRUE;
    } // endif
    } // endfunc

Similar Threads

  1. send email through oracle
    By hurricane850 in forum Oracle Development
    Replies: 1
    Last Post: March 7th, 2005, 12:32 AM
  2. sending email + multiple attachments using php
    By gbow in forum PHP Development
    Replies: 6
    Last Post: February 13th, 2004, 09:31 AM
  3. image word verification
    By jubitzu in forum Perl Programming
    Replies: 1
    Last Post: January 2nd, 2004, 10:54 AM
  4. email problems.
    By darkane in forum PHP Development
    Replies: 4
    Last Post: November 20th, 2003, 09:25 PM
  5. Replies: 2
    Last Post: November 5th, 2003, 03:18 PM

IMN logo majestic logo threadwatch logo seochat tools logo