Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. $pass = $_POST['password'];
  4. $pass2 = $_POST['cpass']; // Password they want to set it to.
  5. $user = $_POST['username'];
  6. if(!defined('INCLUDE_CHECK')) die('You are not allowed to execute this file directly');
  7. mysql_connect('localhost','antonio_sp1','sp1') or die('Unable to establish a DB connection');
  8. if ($_POST['password'] != mysql_query('SELECT pass FROM users'))
  9. {
  10.     die('You\'re password isn\'t correct.');
  11. }
  12. else if (!isset($_POST['password']))
  13. {
  14.     die('Please enter the password.');
  15. }
  16.  
  17. else if (!isset($_POST['cpass']) // Checks if the password they want to change it to is set.
  18. {
  19.     die('Enter a new password');
  20. }
  21.  
  22. else
  23. {
  24.     mysql_query('UPDATE users SET pass="$pass2" WHERE usr="$user"');
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement