Where and how to do Server Side Validation?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
User avatar
urichard
Veteran Member
Posts: 87
Joined: 2018-11-01 12:11

Where and how to do Server Side Validation?

Post by urichard » 2022-12-09 18:47

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
[email protected][/color]

Kind Regards
Richard

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Where and how to do Server Side Validation?

Post by jsetzer » 2022-12-09 19:03

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.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply