enorme push
This commit is contained in:
21
tpCrudTwig/public/roles/add.php
Normal file
21
tpCrudTwig/public/roles/add.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
session_start();
|
||||
|
||||
$SERVER_ROOT = $_SERVER['DOCUMENT_ROOT'] . "/tpCrudTwig";
|
||||
|
||||
require_once($SERVER_ROOT . "/src/Role.php");
|
||||
require_once($SERVER_ROOT . "/src/Twig.php");
|
||||
|
||||
if (isset($_POST)) {
|
||||
if (
|
||||
isset($_POST['name']) && !empty($_POST['name'])
|
||||
) {
|
||||
$name = strip_tags($_POST['name']);
|
||||
AddRole($name);
|
||||
$_SESSION['message'] = "Rôle ajouté avec succès !";
|
||||
header('Location: /tpCrudTwig/public/roles/list.php');
|
||||
}
|
||||
}
|
||||
|
||||
renderTwig("roles/add.twig", array());
|
||||
Reference in New Issue
Block a user