formpassword.php 918 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. session_start();
  3. if ( !isset($_SESSION['user']) )
  4. {
  5. header('Location: signin.php');
  6. exit();
  7. }
  8. ?>
  9. <!DOCTYPE html>
  10. <html>
  11. <head>
  12. <meta charset="utf-8">
  13. <title>Change password</title>
  14. </head>
  15. <body>
  16. <h1>Change password</h1>
  17. <form action="changepassword.php" method="post">
  18. <label for="newpassword">New password</label> <input type="password" id="newpassword" name="newpassword" required>
  19. <label for="confirmpassword">Confirm password</label> <input type="password" id="confirmpassword" name="confirmpassword" required>
  20. <input type="submit" value="Change my password">
  21. </form>
  22. <p>
  23. Go back to <a href="welcome.php">Home</a>.
  24. </p>
  25. <?php if ( isset($_SESSION['message']) && !empty($_SESSION['message']) ) { ?>
  26. <section>
  27. <p><?= $_SESSION['message']; ?></p>
  28. </section>
  29. <?php } ?>
  30. </body>
  31. </html>