<?php require_once '../../../Entity/connexion_db.php'; require_once '../../../Entity/destination.php'; session_start(); if ($_SESSION['admin'] == true) { //echo 'OK'; if (isset($_POST['destination']) && isset($_POST['destination_descr']) && isset($_POST['image'])) { try { $destination = new destination(addslashes($_POST['destination']), $_POST['image'], addslashes($_POST['destination_descr'])); $destination->addDestination($destination->getNom(), $destination->getPhoto(), $destination->getDescription()); header("location:destination-liste.php"); } catch (Exception $ex) { echo 'erreur lors de l\'ajout de la destination' . $ex->getMessage(); } } } 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> <?php include '../navbar.html'; ?>