<?php require_once '../../../Entity/connexion_db.php'; require_once '../../../Entity/aeroport.php'; $bdd = connexion_db::getInstance(); session_start(); if ($_SESSION['admin'] == true) { //echo 'OK'; if (isset($_POST['aeroport']) && isset($_POST['destination_name'])) { try { $aeroport = new aeroport(addslashes($_POST['aeroport']), $_POST['destination_name']); $aeroport->addAeroport($aeroport->getLibelle(), $aeroport->getDest()); header("location:aeroport-liste.php"); } catch (Exception $ex) { echo 'erreur lors de l\'ajout de l\' aeroport ' . $ex->getMessage() . $_POST['destination_name']; } } } else { header('location: ../../index.php'); } ?> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="../../../css/style.css"> <meta charset="UTF-8"> <title>Title</title> </head> <body> <?php