<html>
<body>
<form method=post action="Userpass.php">
Enter UserName :<input type=text name="t1">
Enter Password :<input type=text name="t2">
<input type=submit value="Log In">
</form>
</body>
</html>
Userpass.php-
<?php
$user=$_POST['t1'];
$pass=$_POST['t2'];
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("userpass") or die(mysql_error());
$result=mysql_query("select * from login");
while($row=mysql_fetch_array($result))
{
if((strcmp($user,$row['user'])==0) && (strcmp($pass,$row['pass'])==0))
echo"Login Successful";
else
echo"Invalid user";
}
?>