Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pass = $_POST['password'];
- $pass2 = $_POST['cpass']; // Password they want to set it to.
- $user = $_POST['username'];
- if(!defined('INCLUDE_CHECK')) die('You are not allowed to execute this file directly');
- mysql_connect('localhost','antonio_sp1','sp1') or die('Unable to establish a DB connection');
- if ($_POST['password'] != mysql_query('SELECT pass FROM users'))
- {
- die('You\'re password isn\'t correct.');
- }
- else if (!isset($_POST['password']))
- {
- die('Please enter the password.');
- }
- else if (!isset($_POST['cpass']) // Checks if the password they want to change it to is set.
- {
- die('Enter a new password');
- }
- else
- {
- mysql_query('UPDATE users SET pass="$pass2" WHERE usr="$user"');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement