<?
if ($_SERVER['PHP_AUTH_USER']<>'login' OR $_SERVER['PHP_AUTH_PW']<>'pass')
{
Header('WWW-Authenticate: Basic realm="Admins"');
Header("HTTP/1.0 401 Unauthorized");
exit;
}
?>
<form action="" method="POST">
<input type="password" name="newpass" value=""><br>
<button type="submit" name="add">Add</button>
</form>
if (isset($_POST['newpass'])) {
$newpass = htmlspecialchars(strip_tags(trim($_POST['newpass'])));
mysqli_query($link, "UPDATE `".$mytable."` SET `pass`='".$newpass."' ");
}