login page not picking up the code when loading the page on the browser.
<!--
Here, we write code for login.
-->
<?php
require_once('connection.php');
$email = $password = $pwd = '';
$email = $_POST['email'];
$pwd = $_POST['password'];
$password = MD5($pwd);
$sql = "SELECT * FROM register WHERE Email='$email' AND Password='$password'";
$result = mysqli_query($conn, $sql);
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result))
{
$id = $row["ID"];
$email = $row["Email"];
session_start();
$_SESSION['id'] = $id;
$_SESSION['email'] = $email;
}
header("Location: welcome.php");
}
else
{
echo "Invalid email or password";
}
?>
the error that i got is
Notice: Undefined index: email in F:\HND Second Year\Semester 1\Aram\website_DB_New\Unit_35_Website_Database\USBWebserver v8.6\root\login_code.php on line 9
Notice: Undefined index: password in F:\HND Second Year\Semester 1\Aram\website_DB_New\Unit_35_Website_Database\USBWebserver v8.6\root\login_code.php on line 10 Invalid email or password