0
What is the better language to validate form ? JavaScript Or Php, please I really need an answer.
I have created a JavaScript form validator, but I was told that Php can handle things more than JavaScript can please help me with your opinion and experience, Thanks.
2 Antworten
+ 1
client-side form validation (with Javascript) is faster and provides better user experience, but it's less secure as a hacker can bypass it easily.
server-side form validation (with php or any other) provides worse user experience as the data has to be sent to the server and the page has to reload, and only then the user will know if the data is vaild, but it's safer as no one can bypass it.
a balanced choice would be to implement form validation on both sides 😉
0
so would be better if I check the user inputs first with JavaScript,so I make sure that the user has entered the proper information and that there is no Sql injection or any others, then pass the checked variables to Php right ?