Yii Email Validation Failed

I have an email validation, that should be work to validate email. True condition is: example@ext.com or dash12@ext.com or as_sa@ext.com Another are wrong. So I have this code on function accessrules on the model:

But when I tried to register, it said error, although I have entered the right format. This is my error

I have tried to fix it but still error. Can anyone tell me how to fix it? Thanks all


checkMX is to check the MX record for the email address. Defaults to false. To enable it, you need to make sure the PHP function 'checkdnsrr' exists in your PHP installation. Please note that this check may fail due to temporary problems even if email is deliverable.

You should put your email validation script in model rules not in accessrules of controller. try this

  array("email","patern","your regex for validation","message" => "Email is not correct"),

put this array inside your model rules function array this will work for you.

Need Your Help

Sqlite, How to check if a row contains either string

android string sqlite row

Using the code below i can check if a row contains a single string ( String a) but how would i check if a row equals either string (String a or b)?

How to create incremented view filters for numeric fields in Drupal?

drupal filter drupal-7 drupal-views

In my Drupal 7 I'm building a view of homes/properties with exposed filters of "Minimum Rent" and "Maximum Rent" - so that people can find homes according to their budget.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.