-
Notifications
You must be signed in to change notification settings - Fork 0
/
accutil.php
23 lines (22 loc) · 986 Bytes
/
accutil.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require ("inc/config.php"); #Connexion a la base (inclusion de la connexion par CLASSE PDO:Statement)
require 'functions.php';
session_start();
if (!isset($_SESSION['numutil']) ){
header('Location:index.php');
}
if ($_SESSION['admin'] != 1) {
header('Location:accueil.php');
}
//SI LA VARIABLE POST ACC EXISTE
if (isset($_POST['acc'])) {
$num = htmlentities(intval($_POST['num']));
$statut = 1;
//ON PASSE LE STATUT DE L'UTILISATEUR A 1
$placeparking = $bdd->prepare("UPDATE utilisateurs SET statut = :statut WHERE numutil = :num");
$placeparking->bindValue(':statut', $statut, PDO::PARAM_INT);
$placeparking->bindValue(':num', $num, PDO::PARAM_INT);
$placeparking->execute() or exit(print_r($placeparking->errorInfo()));
header('Location:gestionutil.php');
}else header('Location:accueil.php');
?>