Gossamer Forum
Home : Products : DBMan : Installation :

Valid Expression

Quote Reply
Valid Expression
I want my viewers to confirm their password by adding it twice. What is the best way to validate that password=password1?

Do I create an additional field (password1) in my database, and if so, can I add a valid expression within the database config file saying password=password1 (and if so, how do you write that valid expression), or do I write a script that says if password=password1 then add to database?
Quote Reply
Re: Valid Expression In reply to
Hi Lee,

I would try this (This is of course not tested... Smile )

I assume you are using the create your own account "feature".

In your html_signup_form you would have to add a new field to pass on the submit

Code:
<tr><td><Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399><b>Password again:</b></FONT></td>
<td><input type="PASSWORD" name="pw1"></td></tr>

and then put an if condition to make sure that pw and pw1 are the same in your signup sub (db.pl). Something like

Code:
unless ($in{"pw"} ne $in{"pw1"}) {
$message = "Invalid Passwords. They do not match";}
Quote Reply
Re: Valid Expression In reply to
I guess I already made a poopoo here...

Code:
unless ($in{"pw"} ne $in{"pw1"}) {
$message = "Invalid Passwords. They do not match";}

should probably be
Code:
unless ($in{"pw"} eq $in{"pw1"}) {
$message = "Invalid Passwords. They do not match";}