Sunday, January 11, 2009

Login Check in CGI

#! /usr/bin/perl
use CGI;
use DBI;
$obj=new CGI();
$loginid=$obj->param("login");
$password=$obj->param("pass");
print $obj->header();
$user="root";
$pass="";
$dsn="DBI:mysql:db12:localhost";
$dbh=DBI->connect($dsn,$user,$pass);
$stmt=$dbh->prepare("select * from login where loginid='". $loginid . "' and password='". $password ."'");
print "select * from login where loginid='". $loginid . "' and password='". $password ."'";
$stmt->execute();

$no=$stmt->rows();


if($no==1)
{
print "";
}
else
{
print "";
}
#$dbh->disconnet;

No comments:

Post a Comment