<form name="mod_user_level" action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">
<p align="center">
<label>Username:
<select name="username" id="username">
<option selected="selected">Select a username</option>
<?php
$query = mysql_query("SELECT * FROM `users`") or die(mysql_error());
while ($users = mysql_fetch_array($query))
{
echo '<option value="'.$users['username'].'">'.$users['username'].'</option>';
}
?>
</select>
</label>
<br />
<br />
New Level:
<select name="level" size="1">
<option selected="selected">Select a user level</option>
<option value="1">1 (Normal Member)</option>
<option value="2">2 (Moderator)</option>
<option value="3">3 (Administrator)</option>
</select></p>
<p align="center">
<label>
<input name="mod_level" type="submit" id="mod_level" value="Proceed!" />
</label>
</p>
</form>
and I made a process to change the users user level set in the two drop down menus. But when I do that, I select a username, and then select a level, it dosen't work! it won't change it. Here is the process.
<?php
$username = $_POST['username'];
$level = $_POST['level'];
if($_POST['mod_level']){
$user = ("UPDATE `users` WHERE `username` = '$username' SET `level` = '$level'") or die(mysql_error());
echo"User level has been changed for $username!";
}
?>
Now, does anyone see anythign wrong with that? Because I don't.
