Page 1 of 1

Where and how to do Server Side Validation?

Posted: 2022-12-09 18:47
by urichard
Please can someone assist me in understanding where to go to do serverside validation?

I want to spesifically do a validation on Seeing if a certain user logged in have access to "save" / "submit" a record, and if not it will not update it.

Im sorry for asking such a stupid question but where do i place the code, or do i do the validation with a code on the database mysql?

Im a bit confused about this, any clarity would be appreciated much

Im using cpanel

Re: Where and how to do Server Side Validation?

Posted: 2022-12-09 19:03
by jsetzer
Did you setup permissions correctly in Admin Area for that user's group?

If group is not allowed to edit a record, then user will not be able to save that record.

No reason to do server-side validation (on before update) if user cannot save at all.

Anyway: serverside validation on update can be done in TABLENAME_before_update function in hooks/TABLENAME.php. Do your validation in PHP, then return FALSE if validation fails.