Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. include("config.php');
  3. session_start();
  4. ?>
  5. <html>
  6. <head>
  7. <link rel="stylesheet" href="index.css" type="text/css">
  8. </head>
  9. <body>
  10. <center>
  11. <form method="post" action="">
  12. Gebruikersnaam: <input type="text" name="1"><br>
  13. Wachtwoord: <input type="password" name="2"><br>
  14. <input type="submit" name="submit" value="Registreer!">
  15. </form>
  16. </center>
  17. <?php
  18. if (isset($_POST["submit"])) {
  19. $one = $_POST["1"];
  20. $two = $_POST["2"];
  21. $a = $db->prepare("INSERT INTO Users SET Username=?, Password=?");
  22. $a->execute(array($one, $two));
  23. if ($a) {
  24. echo "<script>alert('Gelukt!');</script>";
  25. $_SESSION['Users'] = $one;
  26. } else {
  27. echo "<script>alert('Niet gelukt!');</script>";
  28. }
  29. }
  30. ?>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement