diff --git a/inc/header.php b/inc/header.php index a8d3d21..854458d 100644 --- a/inc/header.php +++ b/inc/header.php @@ -54,7 +54,13 @@ require_once('inc/core.php'); \ No newline at end of file diff --git a/my_sell.php b/my_sell.php index 7dbbe45..8fad3fe 100644 --- a/my_sell.php +++ b/my_sell.php @@ -54,6 +54,7 @@ include('inc/header.php'); query('SELECT * FROM products WHERE idusers = "' . $_SESSION['id'] . '" ORDER BY date DESC'); if($reponse->fetchColumn() > 0) { + $reponse = $mysql->query('SELECT * FROM products WHERE idusers = "' . $_SESSION['id'] . '" ORDER BY date DESC'); while ($donnees = $reponse->fetch()) { ?>
Cliquez ici si vous n\'êtes pas redirigé automatiquement'); +} +if (isset($_POST['inputEmail']) && isset($_POST['inputPassword']) && isset($_POST['inputLastname']) && isset($_POST['inputFirstname'])) { + $login = filter_input(INPUT_POST, 'inputEmail'); + $password = hash('sha256', filter_input(INPUT_POST, 'inputPassword')); + + $Pdostatinscripton = $mysql->prepare('INSERT INTO users VALUES (NULL, :mail, :motdepasse, :nom, :prenom)'); + + $Pdostatinscripton->bindValue(':mail',$login, PDO::PARAM_STR); + $Pdostatinscripton->bindValue(':motdepasse', $password, PDO::PARAM_STR); + $Pdostatinscripton->bindValue(':nom',filter_input(INPUT_POST, 'inputLastname'), PDO::PARAM_STR); + $Pdostatinscripton->bindValue(':prenom',filter_input(INPUT_POST, 'inputFirstname'), PDO::PARAM_STR); + + $insertIsOk = $Pdostatinscripton->execute(); + + if ($insertIsOk) // Inscription Ok ! + { + $_SESSION['login'] = $login; + $_SESSION['id'] = $mysql->lastInsertId(); + $_SESSION['password'] = $password; + $message = $_SESSION['message'] = 'Vous êtes désormais inscrit !'; + $message_type = $_SESSION['message_type'] = 'success'; + $message_redirect = true; + header('Location: index.php'); + } else // Acces pas OK ! + { + $message = 'Une erreur s\'est produite lors de votre inscription. Réessayez plus tard.'; + $message_type = "danger"; + } + $query->CloseCursor(); + +} +?> + + + + + + + + + + Le coin des g@mers - Identification + + + + + + + + + + + + +
+ +

Identification

+ + + + + + + + + + + + + + + + +
+ S'inscrire +

© 2020

+
+ + +