Old 21-12-2007, 22:32   #1 (permalink)
Maciek
I like Iced Tea
 
Maciek's Avatar
 
Join Date: Nov 2007
Location: Kitchener.Ontario.Canada
Posts: 93
Send a message via MSN to Maciek
Confirm Password Validation

Could someone direct me to a good tutorial on confirming passwords so that both match for validation purposes. Hopefully this can be done with php. I had no luck googling this subject! any help would be appriciated. Thanks
  Reply With Quote
Old 21-12-2007, 22:37   #2 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Uh...can you be more specific?

I mean, it sounds like you're referring to when a user fills in a change password and they have to duplicate it to verify that they are entering what they think they're entering.

Like...

Old Password: ________
New Password: ________
Repeat New Password: ________

I'm not sure what's so difficult about...

PHP Code:
if ($new_password == $repeat_new_password) {
  echo 
"Hooray, they match!";

  Reply With Quote
Old 21-12-2007, 23:14   #3 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,610
Here is a great article on how to use a pear package to create all forms. But one of the things it does is allow you to create password inputs that need to match.
Generating and Validating Web Forms With PEAR HTML_QuickForm
  Reply With Quote
Old 22-12-2007, 14:01   #4 (permalink)
Maciek
I like Iced Tea
 
Maciek's Avatar
 
Join Date: Nov 2007
Location: Kitchener.Ontario.Canada
Posts: 93
Send a message via MSN to Maciek
Thanks guys. !
  Reply With Quote
Old 22-12-2007, 14:05   #5 (permalink)
Maciek
I like Iced Tea
 
Maciek's Avatar
 
Join Date: Nov 2007
Location: Kitchener.Ontario.Canada
Posts: 93
Send a message via MSN to Maciek
but pgo, i need an error message. So is there something that says if $password does not equal $confirmpass then it will echo "your passwords do not match"... I think its "!=" right?...
  Reply With Quote
Old 22-12-2007, 14:16   #6 (permalink)
Maciek
I like Iced Tea
 
Maciek's Avatar
 
Join Date: Nov 2007
Location: Kitchener.Ontario.Canada
Posts: 93
Send a message via MSN to Maciek
SOooooo

PHP Code:
else if ($password != $confirmpass) {
          
$errmsg 'The password which you have entered do not match';
    } 

This totally worked! im happy =)! im learning quickly....
  Reply With Quote
Old 22-12-2007, 14:18   #7 (permalink)
Maciek
I like Iced Tea
 
Maciek's Avatar
 
Join Date: Nov 2007
Location: Kitchener.Ontario.Canada
Posts: 93
Send a message via MSN to Maciek
thanks haku for the link!!!! and thanks pgo.
  Reply With Quote
Old 22-12-2007, 20:39   #8 (permalink)
Shiro
shiro
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,610
No worries.

... but you should check the grammar in $errmssg
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8