Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Can anybody see what I am doing wrong? Thanks#after reading in the values if($username eq "" || $hashPassword == $null) { error(); }else{ #after comparing them to the actual passwords stored in $sth = $db->prepare(q{SELECT userid, password from user where userid = + ?}) or die("usr prepare error: $!"); $usr->execute($username) or die("usr prepare error: $!"); while(@row = $sth->fetchrow_array){ if($username eq $row[0] && $hashPassword eq $row[1]) { #Go to the new page }elsif($username ne $row[0] || $hashPassword != $row[1]) { error(); }elsif($username eq $row[0] && $hashPassword != $row[1]) { error(); }elsif($username ne $row[0] && $hashPassword == $row[1]) { error(); }elsif($username ne $row[0] && $hashPassword != $row[1]) { error(); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: elsif loop
by liverpole (Monsignor) on Dec 12, 2006 at 14:26 UTC | |
|
Re: elsif loop
by jbert (Priest) on Dec 12, 2006 at 14:35 UTC | |
|
Re: elsif loop
by tinita (Parson) on Dec 12, 2006 at 14:46 UTC | |
by Anonymous Monk on Dec 12, 2006 at 15:55 UTC | |
by nimdokk (Vicar) on Dec 12, 2006 at 17:26 UTC | |
|
Re: elsif loop
by blue_cowdawg (Monsignor) on Dec 12, 2006 at 14:26 UTC |