Thanks.
#!/usr/bin/perl
use CGI qw(:standard);
# read form parameters and check them.
# Code for this goes here.
if($DetailsAreCorrect) {
print redirect(-location=>'http://www.yoursite.com/');
}
else {
print header(); # HTTP headers
print start_html('Sorry, something wrong with your input')
# print HTML page explaining errors,
# including new input form.
# Code for this goes here.
print end_html();
}
$db=DBI->connect("dbi:mysql:administration") or die"\n Error($DBI::err):$DBI::errstr\n";
$aquery="select pass from password where username='$username'";
$vquery="select id, unicode from password where username='$username'";
$a=$db->prepare($aquery);
$a->execute();
while(@result=$a->fetchrow())
{foreach $result(@result)
{
if ($result =$password)
{$condition=1;
}
}
}
$b=$db->prepare($vquery);
$b->execute();
while(@bresult=$b->fetchrow())
{
$id=$bresult[0];
$unicode=$bresult[1];
}
if($condition==1)
{print redirect(-location=>'http://localhost/homepage.html');
}
else
{print"content-type:text/html\n\n";
print"<html>\n";
print"<body bgcolor=\"#990000\"><font color=\"white\">";
print "Sorry but your password does not match your username. Please try again. <br><form action=\"login.pl\" method=\"post\" target=\"mainFrame\">Username: <input type=\"text\" name=\"username\" size=\"15\"><br><br><br>
Password: <input type=\"password\" name=\"password\" size=\"15\"><br><br><br><center>
<input type=\"submit\" value=\"Submit\"></form></center>" ;
}
$a->finish();
$b->finish();
$db->disconnect();
Where is my mistake? :-)