I get this error when I ran my php code! any help on what I need to do to fix it?
Notice: Undefined index: username in C:\xampp\htdocs\Slamza\login.php on line 10
Notice: Undefined index: password in C:\xampp\htdocs\Slamza\login.php on line 11
My code is
<?php
session_start();
$username = $_SESSION['username'];
$username = $_POST['username'];
$password = $_POST['password'];
include("connect.php");
if ($username && $password)
{
$queryget = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
$numrows = mysql_num_rows($queryget);
if ($numrows != 0)
{
$_SESSION['username'] = $username;
echo "You have been logged in!";
}
else
{
echo "You have not been logged in";
}
}
else
{
echo "You didn't provide the information needed to login";
include("index.php");
}
?>