0

I'm trying to find a way to validate an email address using CakePHP 1.2 without a model. Can this be done? If so, how can I validate an email address with CakePHP 1.2 without a model?

Thanks!

Mr Mikkél
  • 2,577
  • 4
  • 34
  • 52

1 Answers1

4

1] either use pure php regular expression match against (courtesy of http://www.regular-expressions.info/email.html)

[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}

2] or call the cake email validation function from:

$Validation =& Validation::getInstance();
$result = $Validation->email($tested_email)
ptica
  • 749
  • 8
  • 16