Advertisement
Guest User

forgotpass.php

a guest
Jun 27th, 2015
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. <?php
  2. ini_set('display_startup_errors',1);
  3. ini_set('display_errors',1);
  4. error_reporting(-1);
  5. ?>
  6.  
  7. <?php
  8. /**
  9. * ForgotPass.php
  10. *
  11. * This page is for those users who have forgotten their
  12. * password and want to have a new password generated for
  13. * them and sent to the email address attached to their
  14. * account in the database. The new password is not
  15. * displayed on the website for security purposes.
  16. *
  17. * Note: If your server is not properly setup to send
  18. * mail, then this page is essentially useless and it
  19. * would be better to not even link to this page from
  20. * your website.
  21. *
  22. * Please subscribe to our feeds at http://blog.geotitles.com for more such tutorials
  23. */
  24. include("include/session.php");
  25. ?>
  26.  
  27. <?php
  28. $title = "Forgot Password - The Tax Elephants";
  29.  
  30. $pgDesc="";
  31.  
  32. $pgKeywords="";
  33.  
  34. include ( 'includes/header.php' );
  35. ?>
  36. <!--CONTENT-->
  37.  
  38. <?php
  39. /**
  40. * Forgot Password form has been submitted and no errors
  41. * were found with the form (the username is in the database)
  42. */
  43. if(isset($_SESSION['forgotpass'])){
  44. /**
  45. * New password was generated for user and sent to user's
  46. * email address.
  47. */
  48. if($_SESSION['forgotpass']){
  49. echo "<h1>New Password Generated</h1>";
  50. echo "<p>Your new password has been generated "
  51. ."and sent to the email <br>associated with your account. "
  52. ."<a href=\"login.php\">Login</a>.</p>";
  53. }
  54. /**
  55. * Email could not be sent, therefore password was not
  56. * edited in the database.
  57. */
  58. else{
  59. echo "<h1>New Password Failure</h1>";
  60. echo "<p>There was an error sending you the "
  61. ."email with the new password,<br> so your password has not been changed. "
  62. ."<a href=\"login.php\">Login</a>.</p>";
  63. }
  64.  
  65. unset($_SESSION['forgotpass']);
  66. }
  67. else{
  68.  
  69. /**
  70. * Forgot password form is displayed, if error found
  71. * it is displayed.
  72. */
  73. ?>
  74. <h1>Forgot Password</h1>
  75. A new password will be generated for you and sent to the email address<br>
  76. associated with your account, all you have to do is enter your
  77. username.<br><br>
  78. <?php echo $form->error("email"); ?>
  79. <form action="process.php" method="POST">
  80. <b>Email:</b> <input type="text" name="email" maxlength="30" value="<?php echo $form->value("email"); ?>">
  81. <input type="hidden" name="subforgot" value="1">
  82. <input type="submit" value="Get New Password">
  83. </form>
  84.  
  85. <?php
  86. }
  87. ?>
  88.  
  89. <div class="clear"></div>
  90.  
  91. <?php include( 'includes/footer.php' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement