Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. [CENTER][B][SIZE="3"]Change Password Script[/SIZE][/B][/CENTER]
  2.  
  3. The UberCMS is leaked, therefore incomplete. It has a lot of features missing, including the "Change Password" option. Below is how I would form a change password script (general idea thinking of how it could work, what would need to be coded and what variables may need to be set if you were to officially make one).
  4.  
  5. [B]The HTML:[/B] (could look something like this)
  6. [CODE]
  7.  
  8. <form method="post" action="">
  9. <table>
  10. <tr>
  11. <td>New Password</td>
  12. </tr>
  13. <tr>
  14. <td><input type="password" name="npassword"></td>
  15. </tr>
  16. <tr>
  17. <td>Re-enter New Password</td>
  18. </tr>
  19. <tr>
  20. <td><input type="password" name="rnpassword"></td>
  21. </tr>
  22. <tr>
  23. <td></td>
  24. <td><input type="submit" name="submit"></td>
  25. </tr>
  26. </table>
  27. </form>
  28.  
  29. [/CODE]
  30.  
  31. [B]The PHP:[/B] (could look something like this)
  32.  
  33. [CODE]
  34.  
  35. <?php
  36.  
  37. $error_message_1 = "The new password must be 3-15 characters in length."; //Error Message (password length)
  38.  
  39. [COLOR="SeaGreen"]$susername = $_SESSION['username'];[/COLOR]
  40. $npassword = $_POST['npassword'];
  41. $rnpassword = $_POST['rnpassword'];
  42. $submit = $_POST['submit'];
  43.  
  44. if (isset($submit) == true) {
  45. $password = strtolower(preg_replace("/[^a-zA-Z0-9\-\_\!\$\#\@\^\&\*\(\)\^\+\ \.\?]/", "", $npassword));
  46.  
  47. if ((isset($submit) == true) and ((strlen($npassword) > 15) || (strlen($npassword) < 3) || (strlen($rnpassword) > 15) || (strlen($rnpassword) < 3))) {
  48. echo $error_message_1;
  49. }
  50.  
  51. }
  52.  
  53. ?>
  54.  
  55. [/CODE]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement