I have a index.html page from where i am redirecting it to my login.php page to validate user. But it seems that is its not working. It is showing error message even if the entry are correct. Please look to it
index.html
<form action="login.php" method="POST">
<div class="input-container">
<input type="text" name="enroll" required="required"/>
<label for="Username">Enrollment Number</label>
<div class="bar"></div>
</div>
<div class="input-container">
<input type="password" name="Password" required="required"/>
<label for="Password">Password</label>
<div class="bar"></div>
</div>
<div class="button-container">
<button><span>Go</span></button>
</div>
<div class="footer"><a href="#">Forgot your password?</a></div>
</form>
login.php
<?php
// Grab User submitted information
$enroll = $_POST["enroll"];
$pass = $_POST["password"];
// Connect to the database
$con = mysql_connect("localhost","root","");
// Make sure we connected succesfully
if(! $con)
{
die('Connection Failed'.mysql_error());
}
// Select the database to use
mysql_select_db("rgpv",$con);
$result = mysql_query("SELECT enroll, password FROM login WHERE enroll = $enroll");
$row = mysql_fetch_array($result);
if($row["enroll"]==$enrolls && $row["password"]==$pass)
echo"You are a validated user.";
else
echo"Sorry, your credentials are not valid, Please try again.";
?>