Validating an email address: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{howto|Easy|[[Mark Wittens]] <mark@ | {{howto|Easy|[[Mark Wittens]] <mark@achievo.org>}} | ||
The validation of an email address is easy, just add the email attribute to the node with the email address like this: | |||
<syntaxhighlight lang="php"> | |||
$this->add(new atkEmailAttribute("email", false, AF_OBLIGATORY)); | |||
</syntaxhighlight> | |||
The atkEmailAttribute contains a validation for an email address which will be called automatically, if the second parameter of the constructor is set to "true" a DNS check will be performed on the address domain as well. | |||
Check the functions validateAddressSyntax() and validateAddressDomain() in class.atkemailattribute for details of the validation. | |||
Latest revision as of 09:52, 11 March 2011
|
ATK Howto: Validating an email address
|
The validation of an email address is easy, just add the email attribute to the node with the email address like this:
$this->add(new atkEmailAttribute("email", false, AF_OBLIGATORY));
The atkEmailAttribute contains a validation for an email address which will be called automatically, if the second parameter of the constructor is set to "true" a DNS check will be performed on the address domain as well.
Check the functions validateAddressSyntax() and validateAddressDomain() in class.atkemailattribute for details of the validation.