Подскажите, пожалуйста, в чём проблема?
Notice: Undefined index: telephone in
Notice: Undefined index: idUser in
$sql = "SELECT * FROM `users` WHERE mail = '$mail'";
$row = mysqli_query($db, $sql);
$res = mysqli_fetch_assoc($row);
if($mail == $res['mail'] && $password == $res['password']){
$_SESSION['id'] = $res['id'];
$_SESSION['fname'] = $res['fname'];
$_SESSION['lname'] = $res['lname'];
$_SESSION['telephone'] = $res['telephone'];
$_SESSION['idUser'] = $res['idUser'];
$_SESSION['mail'] = $res['mail'];
$_SESSION['password'] = $res['password'];
$_SESSION['start'] = time();
$_SESSION['expire'] = $_SESSION['start'] + (60 * 60);
header("Location: ../personalPage.php");
}
<?php
session_start();
if (!isset($_SESSION['id'])) {
header("Location: index.php");
}
else{
$now = time();
if ($now > $_SESSION['expire']) {
session_destroy();
header("Location: index.php");
echo "
<script>
alert('Ձեր ժամանակն սպառվեց!');
window.location.href = 'index.php';
</script>
";
}
else{ ?>
<ul>
<li><a href="#?"><?= $_SESSION['fname'] . " " . $_SESSION['lname'];?></a></li>
<li>Հասցե - <a href="#">Qaghaq Armavir</a></li>
<li>Հեռ․ - <a href="#"> <?= $_SESSION['telephone'];?></a></li>
<li>Էլ․ հասցե - <a href="#"><?= $_SESSION['mail'];?></a></li>
<li>ID - <a href="#n"> <?= $_SESSION['idUser'];?></a></li>
</ul>
<?php
}
}
?>