I'm working on a simple login in form that verfies one username and one password using php and javascript. I have a index.php a javascript file to check for errors and a results.php. I can't see anything that I'm doing wrong, but the page continues to submit Invalid login in no matter what is input. Looking for some hints if you guys can give me some. Thanks in advance. I have also looked at similar questions on here and my code pretty much matches the others.
results.php
<?php
$user="joesmith";
$password="abc123";
if(isset($_POST['submit'])){
if(($_POST['user'] == $user) && ($_POST['password'] == $password))
echo "You have successfully logged in";
}
else
{
echo "Invalid login! Try again.";
}
?>
index.php
<body>
<form class="basic-grey" action="results.php" method="post">
<div>
<label for="username" id="lUsernameLabel">* Username:</label>
<input type="text" name="username" id="iUsername" onblur="validateUserName()" onfocus="resetUserName()" />
<div id="dUsernameError" class="errorMessage"></div>
</div>
<div>
<label for="password" id="lPasswordLabel">* Password:</label>
<input type="password" name="password" id="iPassword" onblur="validatePassword()" onfocus="resetPassword()" />
<div id="dPasswordError" class="errorMessage"></div>
</div>
<div>
<input type="submit" class="button" value="Submit" />
</div>