运行我的 php 代码时出现此错误!关于我需要做些什么来解决它的任何帮助?
注意:未定义索引:第 10 行 C:\xampp\htdocs\Slamza\login.php 中的用户名
注意:未定义索引:第 11 行 C:\xampp\htdocs\Slamza\login.php 中的密码
我的代码是
<?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");
}
?>