in reply to login page

I suggest for a start that you add use strict; use warnings; to your code. Most likely a copy and paste error, but there is a missing semicolon after the prepare statement and the following statement. Are you sure both row entries are not null?


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: login page
by Anonymous Monk on Dec 19, 2006 at 02:34 UTC
    Thanks for the feedback. Yes that was a copy and paste error, sorry. I am using
    use strict; use warnings;
    The error() message does not seem to be the problem as it is printing out the correct result in the other if statements in the code i posted. Yes both entries in row should be null when an incorrect username or password are entered. I expected the line
    if($user_name ne $row[0] || $password ne $row[1]) { &error(); } }
    to pick that up. Is this wrong?

      My database fu is not strong, but I'd expect the code to drop out of the while loop if there was not a username match - none of the code in the body of the loop would execute in that case and there would be no error handling for a non-matching user name.


      DWIM is Perl's answer to Gödel