From 5fd9fa480f302902328b81f912dd67ce378284f8 Mon Sep 17 00:00:00 2001 From: citizenz7 Date: Thu, 20 Apr 2017 18:50:55 +0200 Subject: V.1.4.6 --- Html/admin/add-user.php | 156 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 Html/admin/add-user.php (limited to 'Html/admin/add-user.php') diff --git a/Html/admin/add-user.php b/Html/admin/add-user.php new file mode 100644 index 0000000..bd0ea57 --- /dev/null +++ b/Html/admin/add-user.php @@ -0,0 +1,156 @@ + retour sur la page login +if(!$user->is_logged_in()) { + header('Location: login.php'); +} + +if(isset($_SESSION['userid'])) { + if($_SESSION['userid'] != 1) { + header('Location: '.SITEURL); + } +} + +// titre de la page +$pagetitle= 'Admin : ajouter un membre'; +require('../includes/header.php'); +?> + + + +
+ + + +
+
+ +Accueil > '); +for($i=1; $i"; + } + else $prChunks[0]=$dChunks[$i] . ' > '; + echo('">'); + echo(str_replace("_" , " " , $prChunks[0])); +} +?> +

+ + + +

Membres Admin Index

+ +

Ajouter un membre

+ password_hash($_POST['password'], PASSWORD_BCRYPT); + + try { + + //insert into database + $stmt = $db->prepare('INSERT INTO blog_members (username,password,email) VALUES (:username, :password, :email)') ; + $stmt->execute(array( + ':username' => $username, + ':password' => $hashedpassword, + ':email' => $email + )); + + //redirect to index page + header('Location: users.php?action=ajoute'); + exit; + + } catch(PDOException $e) { + echo $e->getMessage(); + } + + } + + } + //check for any errors + if(isset($error)){ + foreach($error as $error){ + echo '

'.$error.'

'; + } + } + ?> + +
+ +


+ '>

+ +


+ '>

+ +


+ '>

+ +


+ '>

+ +

+ +
+
+ + + +
+
+
+ + + + + -- cgit v1.2.1