By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,830 Members | 2,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,830 IT Pros & Developers. It's quick & easy.

How to provide password validation in php form

P: 13
My problem is lik this ,

I am trying to create a PHP registration form for a HR website , but i dont know how provide password validation i.e the password and confirmation password entered by the user should match ...

Can anyone help me ....

Regards,
Shwetha
Sep 18 '08 #1
Share this Question
Share on Google+
3 Replies


dlite922
Expert 100+
P: 1,584
do you have a database?

If not, just create an array with the user name and passwords stored. Once they submit the information check it against this or the database.

If its valid, view the form, if not display an error page.
Sep 18 '08 #2

Atli
Expert 5K+
P: 5,058
It could be as simple as:
Expand|Select|Wrap|Line Numbers
  1. if($_POST['password'] != $_POST['confirmPassword']) {
  2.   echo "Your passwords didn't match. Try again.";
  3. }
  4. else {
  5.   // Process the rest of the form
  6. }
  7.  
Or am I misunderstanding you?
Sep 18 '08 #3

P: 13
It could be as simple as:
Expand|Select|Wrap|Line Numbers
  1. if($_POST['password'] != $_POST['confirmPassword']) {
  2.   echo "Your passwords didn't match. Try again.";
  3. }
  4. else {
  5.   // Process the rest of the form
  6. }
  7.  
Or am I misunderstanding you?
Hi,
Thanks for the reply:) ... It works ..

Regards,
Shwetha
Sep 18 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.