At 04:41 PM 2/5/2004 -0500, Vitaliy Babiy wrote:
>Hi guys!
>
>One more question...
>
>I need to check registration form, so there are two 'password' fields, they must be 
>identical.
>It's simple how to check they are not blank, but how to check identity?
>
>And I need to check if choosen login is exists.
>
>The question is - how to do this, using Data::Validator (CGI::App:ValidateRM)?
>
>
>======================================================
>With best regards
>Vitaliy G. Babiy

constraints => {
uppassword => {
#Make sure passwords are the same
name => 'user_passwords',
constraint => \&DFV::PROF::check_password,
params => [qw(uppassword confirm_password)],
},


sub check_password {
my ($p1, $p2) = @_;

if ($p1 eq $p2) {
return 1;
} else {
return 0;
}
}

Is one way! Of course it is stupidly overcoded, but I had it handy, it was an example 
I did for our PHP coder to look at.

John


>---------------------------------------------------------------------
>Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
>              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to