simple website works perfectly on php 5.3 but after upgrading my php version error is happening on sessions . But to login to my website admin page i have been using the following code.
login.php
<?php
session_start();
$msg = "";
include 'connection/conn.php';
if(isset($_POST['submit']))
{
$email = $conn-> real_escape_string($_POST['email']);
$password = $conn-> real_escape_string($_POST['password']);
$error="Check Your Inputs";
$sql = $conn-> query("SELECT id ,passwor FROM users WHERE email='$email'");
if ($sql->num_rows > 0) {
$data = $sql ->fetch_array();
if (password_verify($password, $data['passwor']))
{
$_SESSION['logedinemail'] = $email;
header("Location: Dash");
exit();
}
else
{
$msg ="Please Check Your Inputs";
}
}
}
?>
and my dashboard
<?php
session_start();
if ($_SESSION['logedinemail']==true) {
}
else
{
header("Location: index.php");
}
?>
But recently i upgraded my php version to 7.2 and the following error shows up PHP Notice: Undefined index: logedinemail in /home/xx/yy/zz/Dash.php on line 3 thanks