<?php include 'header.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$con = mysql_connect("localhost","root","");
$db_selected = mysql_select_db("layout",$con);
$name = $_POST['name'];
$password = $_POST['password'];
if($_POST["submit"] == "LOGIN" )
{
$sql = "SELECT username,password from secure";
$result = mysql_query($sql,$con);
}
while($row = mysql_fetch_array($result,MYSQL_BOTH))
{
if($row['username'] == $name and $row['password'] == $password)
{
echo "welcome " .$name;
}
else
{
echo "Wrong Credentials";
}
}
?>
This code is for a sign in form.
It's showing "Wrong Credentials" followed by "Welcome George", even if the username and password matches.
If the username and password doesn't match it shows as "Wrong Credentials" followed by another "Wrong Credentials".