I have this code:
if($submit)
{
$first=$_POST['first'];
$password=$_POST['password'];
$db = mysql_connect("localhost", "root","");
mysql_select_db("learndb",$db);
$sql = "select * from admin where username = '" . $first . "' and password = '". $password . "'";
$result = mysql_query($sql);
if($result>0)
{
echo "LOGGED IN!!";
}
else
{
echo "ERROR!!!";
}
and my html form is:
<form method="post" action="input-copy.php">
First name:<input type="Text" name="first" placeholder="ENTER YOUR NAME"><br>
password:<input type="password" name="password" placeholder="ENTER PASSWORD"><br>
<input type="submit" name="submit" value="Enter information"></form>
but whatever I enter into firstname and password it displays LOGGED IN!