Data validation is the process to ensure that computer input coming from user is clean, correct and useful. Data validation also checks if field is not empty. If validation fails , response is sent back to the user, then display proper message, so that user can fill the form properly. In the server-side validation, information will sent to the server and then validated using server-side language like php.
Form validation occur at the server, after the user had filled all the fields and pressed the Submit button. If the data entered by a user was incorrect or some data is missing, the server would have to send all the data back to the user and request to fill the form with correct information and then resubmit it . The code for server side validaton in cakephp is written below:
The following code should be copied in your model (User.php)