I have form who validate user input, I use PHP, Javascript and AJAX.
I want to check every field with regex
But I’m little confuse about method to check it…
What’s better method to check it Javascript or PHP?
Thanks in advance..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both. Use JavaScript for the convenience of the user as you can report an error before they submit the form and have to wait for it to process. But never rely on that because evading JavaScript validation is as easy as turning JavaScript off. So always validate on the server side, too. If you’re only going to use one then it should always be server side validation.