#1
  1. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,151
    Rep Power
    220

    Is FILTER VALIDATE EMAIL 100% reliable?


    Hi can I depend on this for valid emails?

    PHP Code:
    if (filter_var($email_aFILTER_VALIDATE_EMAIL)) {
        echo 
    "This ($email_a) email address is considered valid.\n";

  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,760
    Rep Power
    4536
    That's what it's designed for.

    In general, this validates e-mail addresses against the syntax in RFC 822, with the exceptions that comments and whitespace folding and dotless domain names are not supported.
    Although, I'd be putting filtered/verified values into a separate array or variable name, so you know you're only dealing with validated values later on.
    -- Cigars, whiskey and wild, wild women. --
  4. #3
  5. A Change of Season
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    3,151
    Rep Power
    220
    Please explain this

    " Although, I'd be putting filtered/verified values into a separate array or variable name, so you know you're only dealing with validated values later on."

    And

    "- Cigars, whiskey and wild, wild women. -"
  6. #4
  7. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Caro, Michigan
    Posts
    14,760
    Rep Power
    4536
    I like to take values from $_POST['something'], for example, and then store it in $_VALIDATED['something'] after I perform my validation or filtering. This way, later when I need to use 'something' again later in the code, I know I have a value that I've checked. If I go to use $_VALIDATED['name'] and it doesn't exist, that means I didn't do the validation / filter routing on it. Just a concept; not a requirement.

    As for the last part...

    https://www.youtube.com/watch?v=v4rY52SWklc



    -John
    -- Cigars, whiskey and wild, wild women. --

IMN logo majestic logo threadwatch logo seochat tools logo