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.'

'; } } ?>


'>


'>


'>


'>