first commit

This commit is contained in:
2021-09-25 22:45:02 +02:00
parent a4b1e5bdea
commit 1a9410c7b0
13 changed files with 304 additions and 0 deletions

14
addSite.php Normal file
View File

@ -0,0 +1,14 @@
<?php
if (!isset($_POST['siteName'])) {
die("Nom du site manquant !<br/><a href='javascript:history.back(1);'>Revenir en arrière</a>");
}
include "connect.php";
try {
$insert = $db->prepare("INSERT INTO Sites(Name) VALUES(:name)");
$insert->execute(['name' => $_POST['siteName']]);
header("Location: .?site=${_POST['siteName']}");
exit;
} catch(Exception $e) {
echo($e->getMessage() . "<br/><a href='javascript:history.back(1);'>Revenir en arrière</a>");
}
?>