// generate a random salt for this password users->salt = md5(microtime(TRUE)); // create the new password hash $users->password = md5(md5(set_value('newpassword')).$users->salt);