Please help me with this code, its supposed to retrieve the users ID on the database when the user has logged on the blog and allow the user to delete or edit their profile
Here is the code below;
<?php
session_start();
$id = isset($_SESSION['id']);
if ($row['email'] === $email && $row['password'] === $pass) {
$_SESSION['id'] = $row['id'];
$_SESSION['email'] = $row['email'];
header("location: home.php");
exit();
}
echo "ID value: " .$id. "<br>";
if (!isset($_SESSION['email'])) {
if ($row['email'] === $email && $row['password'] === $pass) {
$_SESSION['email'] = $row['email'];
header("location: home.php");
exit();
} else {
header("location: login.php");
exit();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" cotent="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--Bootstrap-->
<link href="https://cdn.jsdelivr.net/npm/
[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!--Font Awesome-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<title>HOME</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>Welcome to the our blog <?php echo htmlspecialchars($_SESSION['email'], ENT_QUOTES, 'UTF-8'); ?></h1>
<br>
<a href="logout.php">Logout</a>
<br>
<br>
<div>
<a href="edit.php?id=<?php echo isset($_SESSION['id']) ? $_SESSION['id'] : ''; ?>" class="link-dark"><i class="fa-solid fa-pen-to-square fs-5 me-3"></i></a>
<a href="delete.php?id=<?php echo isset($_SESSION['id']) ? $_SESSION['id'] : ''; ?>" class="link-dark"><i class="fa-solid fa-trash fs-5 me-3"></i></a>
</div>
<!--Boostrap-->
<script src="https://cdn.jsdelivr.net/npm/
[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>
currently it's giving me that error as shown in the picture