aktuelle.kurse/oldies/m133/5_Vorlagen-und-Loesungen/buecherverwaltung/general/session_start.php
Müller Harald 3fdacd20c0 muh
2022-07-28 09:14:44 +02:00

16 lines
499 B
PHP

<?php
session_start();
if (isset($_SESSION["user"]) and (time() - $_SESSION["timestamp"] < 600)){
$_SESSION["timestamp"] = time();
}
else if (isset($_SESSION['user'])) {
$user = $_SESSION['user'];
unset($_SESSION["user"], $_SESSION["timestamp"]);
$conn = mysqli_connect("localhost", "root", "", "youngster_library") OR
die("Error " . mysqli_error($conn));
mysqli_set_charset($conn, 'utf8');
mysqli_query($conn, "UPDATE konto SET angemeldet = '0' WHERE email = '$user'");
}
?>