在添加管理员时加个确认密码输入并判断的条件
function addAdmin(){ $arr=$_POST; $arr['password']=md5($_POST['password']); $arr['repassword']=md5($_POST['repassword']); if ($arr['password']!==$arr['repassword']){ alertMes("两次密码输入不一致,请重新确认密码。", "addAdmin.php"); }else { unset($arr['repassword']); if(insert("admin",$arr)){ $mes="添加成功!<br/><a href='addAdmin.php'>继续添加</a>|<a href='listAdmin.php'>查看管理员列表</a>"; }else{ $mes="添加失败!<br/><a href='addAdmin.php'>重新添加</a>"; } } return $mes; }