i added the html into the php code (new)
make sure you have chgpasswd.php where the .htpasswd is saved
<?php
echo "<html>";
echo "</head>";
echo "<body bgcolor=darkgreen>";
echo "<form action=chgpasswd.php?htpasswd=save method=post>";
echo " <p>Username: <select name=newuser size=1>";
echo " <option>root</option>";
echo " <option>admin</option>";
echo " <option>user</option>";
echo " <option>support</option>";
echo " </select><br>";
echo " Password: <input type=text size=20 name=newpasswd><br>";
echo "<input type=submit name=Change value=Change> </p>";
echo "</form>";
echo "<form method=POST>";
echo "</form>";
echo "</body>";
echo "</html>";
$htpasswd = $_REQUEST['htpasswd'];
if ($htpasswd == save){
$datau = $_POST['newuser'];
$datau .= ":";
$datau .= $_POST['newpasswd'];
$file = ".htpasswd";
$fp = fopen($file, "w", "a");
fwrite($fp, $datau);
fclose($fp);
echo "<html>";
echo "<title>Password Saved</title>";
echo "<p>Your Login Has Been Changed<p>";
echo "<hr>";
echo "</html>";
}
?>