Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('config.php');
- session_start();
- global $ID;
- $user = $_SESSION['Users'];
- $r = $db -> prepare('select * from Users where Username = ?');
- $r -> execute(array($user));
- $p = $r -> fetchAll(PDO::FETCH_ASSOC);
- foreach ($p as $pp){
- $ID = $pp['ID'];
- }
- ?>
- <html>
- <body>
- <center>
- <form method="post" action="">
- Gebruikersnaam: <input type="text" name="1"><br>
- Wachtwoord: <input type="password" name="2"><br>
- <input type="submit" name="submit" value="Submit">
- </form>
- </center>
- <?php
- if (isset($_POST["submit"])) {
- $one = $_POST["1"];
- $two = $_POST["2"];
- $a = $db->prepare("update Users SET Username=?, Password=? WHERE ID=?");
- $a->execute(array($one, $two, $ID));
- if ($a) {
- echo "<script>alert('Gewijzigd!');</script>";
- Header('Location: uitloggen.php');
- } else {
- echo "<script>alert('Helaas, niet gewijzigd!');</script>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement