[Fri Aug 16 21:49:25 2002] [error] [client 127.0.0.1] [Fri Aug 16 21:49:25 2002] amysloan.cgi: Database handle destroyed without explicit disconnect., referer: http://localhost/cgi-bin/amysloan.cgi [Fri Aug 16 21:49:31 2002] [error] [client 127.0.0.1] [Fri Aug 16 21:49:31 2002] amysloan.cgi: Use of uninitialized value in string ne at C:/Program Files/Apache Group/Apache2/cgi-bin/amysloan.cgi line 32., referer: http://localhost/cgi-bin/amysloan.cgi #### #!/Perl/bin/perl -w use Digest::MD5 qw/md5_base64/; use CGI::Carp qw/fatalsToBrowser/; use CGI qw/:standard/; use DBI; use strict; print "Content-type:text/html\n\n"; my %info; my $driver = "mysql"; my $database = "amy"; my $dsn = "DBI:$driver:database=$database;host=localhost"; my $dbh = DBI->connect($dsn) or die "Couldnt connect: $DBI::errstr\n"; my $username = param('username'); my $password = md5_base64(param('password')) if param('password'); if(!$username){ relogin("Enter your username"); }elsif(!$password){ relogin("Enter your password"); } my $sth = $dbh->prepare("SELECT * FROM info WHERE pword='$password'"); $sth->execute() or die "Couldnt do it: $!\n"; while(my $ref = $sth->fetchrow_hashref){ %info = %{$ref}; } $sth->finish(); $dbh->disconnect(); if($username ne $info{'uname'}){ relogin("Invalid Username"); } if($password ne $info{'pword'}){ relogin("Invalid Password"); } print $info{'loan'}; sub relogin{ my $msg = shift; print < Login
$msg
Login:
Password:
HtmlCode exit; }