The PHP code is as follows:
<html>
<?php
$username = $_POST['user'];
$password = $_POST['pass'];
$username = stripcslashes($username);
$password = stripcslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
mysql_connect("localhost", "root", "");
mysql_select_db("login");
$result = mysql_query("select * from users where username = '$username' and password = '$password'")
or die ("Failed to query database ".mysql_error());
$row = mysql_fetch_array($result);
$dbusername = $row['username'];
$dbpassword = $row['password'];
if ($username == $dbusername); {
echo "login succesfull";
}
else
{
echo "failed to login";
}
?>
</html>
and the login page code is:
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<img src="WCCS Logo.png" id="schoollogo">
<div id="frm">
<form action="process.php" method="POST">
<p>
<label>Username: </label>
<input type="text" id="user" name="user"/>
</p>
<p>
<label>Password: </label>
<input type="password" id="pass" name="pass" />
</p>
<p>
<input type="submit" id="btn" value="login" />
</p>
</form>
</div>
</body>
The database is named login and the table is called users it has id, username, password, first name and last name columns with entered information.
For some unknown reason when I click the submit button it brings up a blank page, although the url changes to the page and when I add some type of text like a html paragraph it displays it.
So it goes to the page, also there is a css file if needed, it was working a couple days ago and now it is not. I dont understand what is wrong with it.
It is like the PHP doesnt even get run, its just ignored