Skip to content
Snippets Groups Projects
Commit d3fad337 authored by DESERT Romain's avatar DESERT Romain
Browse files

debug create account

parent d6f9c7b3
No related branches found
No related tags found
1 merge request!1Merge Request - Développement vers Main (Draft)
...@@ -9,7 +9,6 @@ $inscription_error = null; ...@@ -9,7 +9,6 @@ $inscription_error = null;
if ($_SERVER["REQUEST_METHOD"] == "POST" && !isset($_POST['inscription'])) { if ($_SERVER["REQUEST_METHOD"] == "POST" && !isset($_POST['inscription'])) {
try { try {
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL); $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
$password = $_POST['password']; $password = $_POST['password'];
...@@ -45,8 +44,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && !isset($_POST['inscription'])) { ...@@ -45,8 +44,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && !isset($_POST['inscription'])) {
} }
} }
require_once INCLUDES_PATH . '/header.php';
// Traitement du formulaire d'inscription // Traitement du formulaire d'inscription
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) { if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) {
try { try {
...@@ -74,7 +71,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) { ...@@ -74,7 +71,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) {
'email' => $email, 'email' => $email,
'date_de_naissance' => $date_de_naissance, 'date_de_naissance' => $date_de_naissance,
'password' => $hashed_password, 'password' => $hashed_password,
'role' => 'membre' 'role' => 'adherent'
]); ]);
header('Location: login.php?success=1'); header('Location: login.php?success=1');
...@@ -85,9 +82,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) { ...@@ -85,9 +82,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) {
$inscription_error = "Tous les champs sont obligatoires"; $inscription_error = "Tous les champs sont obligatoires";
} }
} catch (PDOException $e) { } catch (PDOException $e) {
$inscription_error = "Erreur de connexion à la base de données"; $inscription_error = "Erreur de connexion à la base de données : " . $e->getMessage();
} }
} }
require_once INCLUDES_PATH . '/header.php';
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
...@@ -145,7 +144,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) { ...@@ -145,7 +144,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['inscription'])) {
.card-side::after { .card-side::after {
position: absolute; position: absolute;
content: 'S inscrire'; content: "S'inscrire";
left: 70px; left: 70px;
top: 0; top: 0;
width: 100px; width: 100px;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment