Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Recup l'user par l'ID
- if(isset($_GET['id']) AND $_GET['id'] > 0) {
- $getid = intval($_GET['id']);
- $requser = $bdd->prepare('SELECT * FROM users WHERE id = ?');
- $requser->execute(array($getid));
- $userinfo = $requser->fetch();
- // Ajout d'un utilisateur
- if(isset($_POST['pseudo']) AND !empty($_POST['pseudo']) AND $_POST['pseudo'] != $userinfo['pseudo']) {
- $pseudo = htmlspecialchars($_POST['pseudo']);
- $userid = $userinfo['id'];
- $insertpseudo = $bdd->prepare("UPDATE users SET pseudo = ? WHERE id = ?");
- $insertpseudo->execute(array($pseudo, $userid));
- header("Location: admin-users.php");
- }
- if(isset($_POST['email']) AND !empty($_POST['email']) AND $_POST['email'] != $userinfo['mail']) {
- $email = htmlspecialchars($_POST['email']);
- $userid = $userinfo['id'];
- $insertemail = $bdd->prepare("UPDATE users SET mail = ? WHERE id = ?");
- $insertemail->execute(array($email, $userid));
- header("Location: admin-users.php");
- }
- if(isset($_POST['actif']) AND !empty($_POST['actif']) AND $_POST['actif'] != $userinfo['actif']) {
- $actif = $_POST['actif'];
- $userid = $userinfo['id'];
- $insertactif = $bdd->prepare("UPDATE users SET actif = ? WHERE id = ?");
- $insertactif->execute(array($actif, $userid));
- header("Location: admin-users.php");
- }
- ?>
- <input class="form-control" type="checkbox" name="actif" id="actif" value="<?php echo $userinfo['actif']; ?>" <?php if ($userinfo['actif'] == "1") { echo "checked"; } ?>>
- <input type="hidden" name="actif" value="1" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement