in reply to CGI Login script error

What does the server's error log say?

If you don't have access to it, use CGI::Carp:
use CGI::Carp qw(fatalsToBrowser);

Replies are listed 'Best First'.
Re^2: CGI Login script error
by mattdope (Acolyte) on Jul 13, 2006 at 21:15 UTC
    thanks for that. I used :
    #!/usr/local/bin/perl -Tw use CGI::Carp qw(fatalsToBrowser); die "Bad error here";
    I am now getting "Bad error here at sampleForm.cgi line 3" Any ideas what i am doing wrong?
        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();
        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();