<?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();
        }
    }
}