<table width="250" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="23">
<?php
if(isset( $_SESSION['msg']))
{
echo "<font class='style1'>CHECK EMAIL & PASSWORD</font>";
}
else {
echo "<font class='style1'>Welcome Guest</font>";
}
?>
</td>
</tr>
<tr>
<td height="25" bgcolor="#2495B5"> </td>
</tr>
<tr>
<td width="250" height="150" bgcolor="#F6F6F6">
<form id="form1" name="form1" method="post" action="logindb.php">
<table width="98%" border="0" cellspacing="0">
<tr>
<td width="47%"> <span class="style1">Email ID </span></td>
<td width="53%"><input name="Email" type="text" size="11" /></td>
</tr>
<tr>
<td> <span class="style1">Password</span></td>
<td><input name="Password" type="password" size="13" /></td>
</tr>
<tr>
<td>
<table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10"> </td>
<td><a href="registerpage.php"><span class="style1">Register</span></a></td>
</tr>
</table></td>
<td><input type="image"name="Submit" src="images/login.jpg"/></td>
</tr>
<tr>
<td colspan="2"><div align="center"> <a href="forgotpassword.php"><span class="style1">Forgot Password </span></a></div></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
logindb.php
<?php
session_start();
if(isset($_POST['Email']))
{
$email = $_POST['Email'];
$password = $_POST['Password'];
if(strlen($email)!=0 && strlen($password)!=0)
{
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("reelload", $con);
$result = mysql_query("SELECT * FROM users where email='".$email."' AND password='".$password."'");
if($row=mysql_fetch_array($result))
{
$_SESSION['Email']=$email;
$_SESSION['msg']="Welcome".$email;
//echo "email exist";
header("Location:homepage.php");
}
else{
$msg2 = "check USERNAME & PASSWORD";
$_SESSION['msg']="Please".$msg2;
//echo "email doesnot exist";
header("Location:loginpage.php");
}
}
}
else
{
echo "username does not exist" ;
}
?>
in login page the php code used to display CHECK USER & PASSWORD
is not working
please can any one help me in this