verifica
This commit is contained in:
parent
2c82d90dd4
commit
5f80048cec
20 changed files with 999 additions and 1 deletions
24
moro_detto_rocco_andrea_biciclette/includes/functions.php
Normal file
24
moro_detto_rocco_andrea_biciclette/includes/functions.php
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue