#!c:/perl/bin/perl.exe use DBI; $,="\t"; use CGI qw(:all escape); $username=param("username"); $password=param("password"); $condition; $cond; $db=DBI->connect("dbi:mysql:administration") or die"\n Error($DBI::err):$DBI::errstr\n"; $aquery="select pass from password where username='$username'"; $a=$db->prepare($aquery); $a->execute(); while(@result=$a->fetchrow()) {foreach $result(@result) { if ($result eq $password) {$condition=1; } } } if($condition==0) {print"content-type:text/html\n\n"; print"\n"; print""; print "Sorry but your password does not match your username. Please try again.
Username:


Password:


" ; } else { print redirect(-location=>'http://localhost/cgi-bin/de.pl?username=$username'); }