Guest User

Untitled

a guest
Apr 6th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <?php
  2.  
  3. if( isset( $_GET[ 'Change' ] ) ) {
  4. // Get input
  5. $pass_new = $_GET[ 'password_new' ];
  6. $pass_conf = $_GET[ 'password_conf' ];
  7.  
  8. // Do the passwords match?
  9. if( $pass_new == $pass_conf ) {
  10. // They do!
  11. $pass_new = ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $pass_new ) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : ""));
  12. $pass_new = md5( $pass_new );
  13.  
  14. // Update the database
  15. $insert = "UPDATE `users` SET password = '$pass_new' WHERE user = '" . dvwaCurrentUser() . "';";
  16. $result = mysqli_query($GLOBALS["___mysqli_ston"], $insert ) or die( '<pre>' . ((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)) . '</pre>' );
  17.  
  18. // Feedback for the user
  19. $html .= "<pre>Password Changed.</pre>";
  20. }
  21. else {
  22. // Issue with passwords matching
  23. $html .= "<pre>Passwords did not match.</pre>";
  24. }
  25.  
  26. ((is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"]))) ? false : $___mysqli_res);
  27. }
  28.  
  29. ?>
Add Comment
Please, Sign In to add comment