This commit is contained in:
Andrea Moro 2025-02-13 13:03:02 +01:00
parent 2c82d90dd4
commit 5f80048cec
20 changed files with 999 additions and 1 deletions

View file

@ -0,0 +1,24 @@
<?php
session_start();
$host = "127.0.0.1";
$database = "biciclette";
$user = "pdo";
$password = "";
function getDbConnection()
{
global $host, $database, $user, $password, $database;
return new PDO("mysql:host=$host;dbname=$database", $user, $password);
}
function checkSession()
{
if (empty($_SESSION["llivello"]) || empty($_SESSION["login"])) {
if($_SESSION["llivello"] != 0){
$_SESSION["error"] = "Errore interno (Sessione non trovata)";
header("Location: login.php");
exit();
}
}
}