flap Posted December 25, 2022 Share Posted December 25, 2022 Hello everyone, i'm looking for some best or most used way to validate a form data. I saw something with regexp used and preg_match, also i saw something like filter_input. What's the best way? I have only 3-4 fields in form. Login, email and password. Have a good day Quote Link to comment https://forums.phpfreaks.com/topic/315728-validating-the-form-before-create-user-in-database/ Share on other sites More sharing options...
requinix Posted December 26, 2022 Share Posted December 26, 2022 Email addresses can be validated with filter_var or filter_input. Password "validation" depends on what you want to do but, yes, typically regular expressions are involved. We can give much more precise answers if you can give us much more precise questions. Exactly what do you want it do? Quote Link to comment https://forums.phpfreaks.com/topic/315728-validating-the-form-before-create-user-in-database/#findComment-1603914 Share on other sites More sharing options...
maxxd Posted December 26, 2022 Share Posted December 26, 2022 Typically you'll want to validate twice; first you validate on the client side in order to give immediate feedback to the user, and the you do it server-side to verify the data and protect the overall system. 1 Quote Link to comment https://forums.phpfreaks.com/topic/315728-validating-the-form-before-create-user-in-database/#findComment-1603930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.