Should you do validation on the server side, or is it ok to just do the validation on the client side?
@TheTXI
I am happy your amazed I just did not want to leave anything out that could potential change someone answer to give me false information.
It seems alot of people touched on what I was going after but the part of the Ajax should have been kept in my question as this was the most important part.
However reading the posts I know see that a bad person could just easily load up firebug and change my button to a submit button and do a post. Or some other way.
In general, it is best to perform input validation on both the client side and server side. Client-side input validation can help reduce server load and can prevent malicious users from submitting invalid data.
Input validation must always be done on the server-side for security. While client side validation can be useful for both functional and some security purposes it can often be easily bypassed. This makes server-side validation even more fundamental to security.
You should always check the data in the backend. So, while providing frontend validation is nice in concerns of usability, it's totally not neccessary. Backend validation on the other hand is and it's the only way to have sane data.
With the help of server-side validation, we can get protection against malicious users. On the other hand, the user input validation that takes place on the client side is called client-side validation. Scripting languages such as JavaScript and VBScript are used for client-side validation.
Browser/client-side validation is a convenience. You cannot rely on it. You absolutely need to duplicate any client-level validation with server-side validation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With