遵循客户端或服务器端验证的最佳做法是哪种? [关闭]

Which is the best practice to follow either client side validation or server side validation using php and what to follow and why to follow?

I would say both.

Client side validation is important for confirmation to the user of what exactly it is they are doing wrong and why. This can be a real time update and does not require any server side interaction (although it can).

Server side validation is for your confirmation rather than the users to check that the information provided is indeed correct and what you would expect.

Both have their place and are equally as useful as one another.

The server side validations must include the use of strip_slashes to prevent the SQL injection attacks...

On the client side, do the necessary validations and checks using Jquery or JavaScript so as to reduce the load of the server...

You can altogether ignore them but if your app has a lot of traffic then you should consider this but the server side validations are a must...