Html site 4 5/1/2017


SUBMITTED BY: canonical

DATE: May 2, 2017, 1:14 a.m.

FORMAT: HTML+PHP

SIZE: 1.9 kB

HITS: 238

  1. If you want more of my pastes visit: https://randompaste.000webhostapp.com/index.html
  2. --------------------------------------------------------------------------------------
  3. <?php include("db.php"); ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <title>EasySchool</title>
  8. <meta charset="utf-8">
  9. <link rel="stylesheet" type="text/css" href="css/styles.css">
  10. <link rel="shortcut icon" href="img/schoolwin.png">
  11. </head>
  12. <body>
  13. <?php include("include/navbar.php"); ?>
  14. <h1>Inscription </h1>
  15. <form method="post" class="forminscription">
  16. <input type="text" name="pseudo" id="pseudo" class="inputbasic">
  17. <input type="password" name="password" id="password" class="inputbasic">
  18. <input type="email" name="email" id="email" class="inputbasic mail">
  19. <input type="text" name="name" id="name" class="inputbasic">
  20. <input type="text" name="surname" id="surname" class="inputbasic">
  21. <input type="submit" name="formsend" id="formsend">
  22. </form>
  23. <?php if(isset($_POST['formsend'])){
  24. $pseudo = $_POST['pseudo'];
  25. $password = $_POST['password'];
  26. $email = $_POST['email'];
  27. $name = $_POST['name'];
  28. $surname = $_POST['surname'] ;
  29. if(!empty($pseudo) && !empty($password) && !empty($email) && !empty($name) && !empty($surname)){
  30. $options = [
  31. 'cost' => 12,
  32. ];
  33. $hashpass = password_hash($password, PASSWORD_BCRYPT, $options);
  34. $req = $pdo->prepare('INSERT INTO user SET username = ?, password = ?, email = ?, name = ?, surname = ?');
  35. $req->execute([
  36. $pseudo,
  37. $hashpass,
  38. $email,
  39. $name,
  40. $surname
  41. ]);
  42. }
  43. } ?>
  44. <?php include("include/footer.php"); ?>
  45. </body>
  46. </html>

comments powered by Disqus