in reply to Re^2: CGI Login script error
in thread CGI Login script error

It means that script works. I.e. it sends the die() error out to the browser.

Try putting the CGI::Carp line in your original script (at the top).

Replies are listed 'Best First'.
Re^4: CGI Login script error
by mattdope (Acolyte) on Jul 13, 2006 at 21:36 UTC
    I used this but I am now getting the internal server error again.
    #!/usr/local/bin/perl -Tw use CGI::Carp qw(fatalsToBrowser); print header(); $testUsername = param( "username" ); $testPassword= param( "password" ); open( PW, "password.txt" ) || die( "The database could not be opened." ); while ( $line = <PW> ) { chomp( $line ); ( $username, $password ) = split( ",", $line ); chop($password); if ( $testUsername eq $username ){ $userVerified = 1; if ( $testPassword eq $password ) { $passwordVerified = 1; } } } close( PW ); print header(); print start_html("Checking password!"); if ( $userVerified&& $passwordVerified ) { print "Permissionhas been granted, $testUsername .<br>"; print "Enjoy the site!< br>" } elsif ( $userVerified && !$passwordVerified ) { print "You entered an invalid password. <br>"; print "Access has been denied. <br>"; } else { print "You have been denied access to this site.<br>"; } print end_html();
Re^4: CGI Login script error
by mattdope (Acolyte) on Jul 13, 2006 at 21:42 UTC
    I tried this but still getting internal error message:
    #!/usr/local/bin/perl -Tw use CGI::Carp qw(fatalsToBrowser); print header(); $testUsername = param( "username" ); $testPassword= param( "password" ); open( PW, "password.txt" ) || die( "The database could not be opened." ); while ( $line = <PW> ) { chomp( $line ); ( $username, $password ) = split( ",", $line ); chop($password); if ( $testUsername eq $username ){ $userVerified = 1; if ( $testPassword eq $password ) { $passwordVerified = 1; } } } close( PW ); print header(); print start_html("Checking password!"); if ( $userVerified&& $passwordVerified ) { print "Permissionhas been granted, $testUsername .<br>"; print "Enjoy the site!< br>" } elsif ( $userVerified && !$passwordVerified ) { print "You entered an invalid password. <br>"; print "Access has been denied. <br>"; } else { print "You have been denied access to this site.<br>"; } print end_html();