Liste des membres
Edition du profil membre
0){
if($password ==''){
$error[] = 'Veuillez entrer un mot de passe.';
}
if($passwordConfirm ==''){
$error[] = 'Veuillez confirmer le mot de passe.';
}
if($password != $passwordConfirm){
$error[] = 'Les mots de passe ne concordent pas.';
}
}
if($email ==''){
$error[] = 'Veuillez entrer une adresse e-mail.';
}
if(!isset($error)){
try {
if(isset($password)){
$hashedpassword = $user->password_hash($password, PASSWORD_BCRYPT);
//update into database
$stmt = $db->prepare('UPDATE blog_members SET username = :username, password = :password, email = :email WHERE memberID = :memberID') ;
$stmt->execute(array(
':username' => $username,
':password' => $hashedpassword,
':email' => $email,
':memberID' => $memberID
));
} else {
//update database
$stmt = $db->prepare('UPDATE blog_members SET username = :username, email = :email WHERE memberID = :memberID') ;
$stmt->execute(array(
':username' => $username,
':email' => $email,
':memberID' => $memberID
));
}
//redirect to index page
header('Location: users.php?action=updated');
exit;
} catch(PDOException $e) {
echo $e->getMessage();
}
}
}
?>
';
}
}
try {
$stmt = $db->prepare('SELECT memberID, username, email FROM blog_members WHERE memberID = :memberID') ;
$stmt->execute(array(':memberID' => $_GET['id']));
$row = $stmt->fetch();
} catch(PDOException $e) {
echo $e->getMessage();
}
?>