#!/usr/local/bin/perl -Tw use CGI qw( :standard -debug); $testUsername = param( "username" ); $testPassword= param( "password" ); open( PW, "password.txt" ) || die( "The database could not be opened." ); while ( $line = ) { 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 .
"; print "Enjoy the site!< br>" } elsif ( $userVerified && !$passwordVerified ) { print "You entered an invalid password.
"; print "Access has been denied.
"; } else { print "You have been denied access to this site.
"; } print end_html();