#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
$password_dir = '/home/dat/';
$pword_file=".passlist";
$NotFound="false";
$passwrd_location="$password_dir$pword_file";
if (-e $passwrd_location) {
open(USERFILE, $passwrd_location) || die ("Could not open $pword_file.");
$userid_entd = $formdata{'UserID'};
while ($record = ) {
if ($record =~ /^$userid_entd\|/) { $pword_entd=$formdata{'PWord'};
($userid, $pword) = (split(/\|/, $record));
chomp($pword);
if (($pword eq $pword_entd) && ($userid_entd == $userid)) {
print "You are a valid user
";
$NotFound="false";
exit;
} else {
print "The password you entered is incorrect";
exit; }
}else {
$NotFound eq "true"; }
}
close(USERFILE); }
if (($NotFound eq "false") || ($userid_entd eq " ")) {
print "The user id you entered is incorrect";
exit;
}