Javascript validation and PHP validation?

I am using jquery validation plugin to validate empty forms. Should I also test this in PHP to be 100% sure? Or is this normal with javascript validation. Thanks

+4
source share
3 answers

You should always perform your check on the server.

What happens if the user somehow submits the form without using Javascript? Then the whole JS check is null and empty. Never trust javascript. This is a very good tool to use to make the site smooth, etc., but you cannot assume that the user will use it, even if you set it to something that you do not allow them to send normally.


When I personally set the check on the client and server side, I try to ensure that they are exactly the same validations. Thus, the user usually does not see the server check, but if something goes wrong, the information is still checked as necessary.

+8
source

Users can disable javascript, which will bypass all your checks. For this reason you should always check input with php. Validation with javascript basically consists in using the visual effects of ajax and jquery. This check is always server-side.

+1
source

javascript is executed by the client, so it is easy to fool it. ALWAYS also use server side validation.

+1
source

All Articles