Ok so I get this error when i try to login:
Notice: Undefined variable: numrows in C:\xampp\htdocs\website\login.php on line 14
That user doesn't exist. Do you notice any errors right away trying to learn PHP and MySQL. Here is the code
INDEX PHP PAGE
<html>
<form action="login.php" method="POST">
Username: <input type="text" name="username"><br />
Password: <input type="password" name="password"><br />
<input type="submit" name="Login In"><br />
</form>
</html>
PHP LOGIN PAGE
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username&&$password)
{
$connect = mysql_connect("localhost","root","") or die("Couldn't Connect!");
mysql_select_db("phplogin") or die("Couldn't Find DB!");
$query = mysql_query("SELECT * FROM users WHERE username='username'");
$numrow = mysql_num_rows($query);
if ($numrows!=0)
{
// code to login
}
else
die("That user doesn't exist");
}
else
die("Please enter and username and password!");
?>