<?php
error_reporting(0);
$adminpwd = md5($_POST['adminpwd']);
$enter = $_POST['enter'];
$servername = "localhost";
$username = "root";
$password = "";
if ($enter)
{
$connect = mysql_connect($servername, $username, $password) or die(mysql_error());
mysql_select_db("bctravels") or die(mysql_error());
$query = mysql_query("SELECT admin_pwd FROM admin");
$numrows = mysql_num_rows($query);
if($numrows!=0)
{
while ($rows = mysql_fetch_assoc($query))
{
$db_admin_pwd = $rows['admin_pwd'];
}
if ($adminpwd==$db_admin_pwd)
{
session_register("adminpwd");
header("location:admin_home.php");
}
else
echo "/////";
}
else
echo "...";
}
?>
<html>
<head>
<link href="../admin/admin.css" rel="stylesheet" type="text/css" />
<title>Administration password check</title>
</head>
<body>
<center><div>
<h3>You're the Administrator</h3>
<br/>
<form action='admin_pwd.php' method='POST'>
Enter Admin Password,
<br/>
<input type='password' name='adminpwd'>
<br/>
<input type='submit' name='enter' value='enter'>
</form>
</div></center>
</body>
</html>
I dont know why the $adminpwd and $db_admin_pwd doesnot match,
is there any error in my coding,
please help.



