PHP Admin Change Password For User

Hello,

In my administration panel, I want to make a page where the admin can change the password for a specific user. My goal is to have a little dropdown box where the users can populate there, and then a box underneath that where the admin can type the new password.

Can anyone give me a tutorial for this? I do not even know how to go about it.

~b

First you need to make the PHP to get the data from the users table, and identify the main variables, such as user id, and username.

Then you create a form and then in the <form> tags, you would put something like:

<select name=“user”>
<option value=“$userid”>$username</select>
</select>

This will populate your drop down boxes with all of the usernames and set the user ids as the “key”.

Then create your form for the password which is pretty easy. Where your form submits to, the php part, you would do something like:

$user =  ($_POST['user']);
$password =  ($_POST['password']);

  mysql_query("UPDATE users SET password = '$password' WHERE id='$user'")