Cant change a users password via my form.
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
it looks like that becuase its hashed with md5. you don't store a password in a database without hashing it. it goes like this
-user makes password, password is hashed, hash is stored in the database.
-user logs in, password entered is hashed, hashed password is checked against the hash already stored in the database, if its a match then they get logged in.
the reason you want to save the hash in the db is becuase if someone hacks your database and somehow is able to see the contents of it, you don't want them to have everyones password!
-user makes password, password is hashed, hash is stored in the database.
-user logs in, password entered is hashed, hashed password is checked against the hash already stored in the database, if its a match then they get logged in.
the reason you want to save the hash in the db is becuase if someone hacks your database and somehow is able to see the contents of it, you don't want them to have everyones password!
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<?php echo (isset($_POST['password'])) ? md5($_POST['password']) : $admin_update->old_user_password; ?>Isnt this the code that check to see if its even set?
Code: Select all
if (isset($_POST['Submit'])) {
if ($_POST['Submit'] == "Update") {
$conf_str = (isset($_POST['send_confirmation'])) ? $_POST['send_confirmation'] : ""; // the checkbox value to send a confirmation mail
$admin_update->update_user_by_admin($_POST['level'], $_POST['user_id'], $_POST['password'], $_POST['email'], $_POST['activation'], $conf_str);
$admin_update->get_userdata($_POST['login_name']); // this is needed to get the modified data after update
} elseif ($_POST['Submit'] == "Search") {
$admin_update->get_userdata($_POST['login_name']);
}
} elseif (isset($_GET['login_id']) && intval($_GET['login_id']) > 0) {
$admin_update->get_userdata($_GET['login_id'], "is_id");
}
$error = $admin_update->the_msg; // error message
?>