MySQL Forums
Forum List  »  Perl

my perl programm is not give correct output,plz help
Posted by: arupratan biswas
Date: May 03, 2005 05:46AM

hey i fetch strange problem on my perl prpgramming,my programm is not
give the proper output which actually i want.when i put the correct username
and password but again my output is look like that "username or password
incorrect" Try again.
my code just as follows:

use CGI;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
use DBI;
use Digest::MD5 qw(md5 md5_hex md5_base64);

my $query = new CGI;
print $query->header();
print $query->start_html(-title=>'LOGIN PAGE');


if(($query->request_method() eq "POST") && ($query->param("user") ne '') && ($query->param("password") ne ''))

$md5password = md5($chkpassword);

$dbh = DBI->connect("DBI:mysql:database=$db:host=$host", $user, $password) or die "Can't connect to database:$DBI::errstr\n";
$qry = $dbh->prepare("SELECT emp_name, password FROM new_user where emp_name='$chkuser'");



#print "name = $name , password = $pass, md5password = $md5password";
if (($chkuser eq $name) && ($md5password eq $pass))
print "<p> Thank You!<p>";
print $query->end_html();
print "<HEAD> Username or Password Incorrect!</HEAD>";
print "<a href='/cgi-bin/test/'>Please Try Again</a>";

print $query->end_html();
print "Content-type: text/html\n\n";

#print << EOF;
print "<HTML>";
print "<BODY>";
print "<FORM METHOD='POST' ACTION='/cgi-bin/test/'>";

print "<p>Username:</p>";
print "<input type='text' name='user'><br>";

print "<p>Password:</p>";
print "<input type='password' name='password'><br>";
print "<input type='submit' value='submit'><br>";
print "</FORM>";
print "</BODY>";
print "</HTML>";
print $query->end_html();

if anybody there plz help me.

Options: ReplyQuote

Written By
my perl programm is not give correct output,plz help
May 03, 2005 05:46AM
May 05, 2005 12:48AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.