📄 adduser.asp
字号:
<!--#include file="conn.asp" -->
<!--#include file="../char.asp" -->
<html>
<head>
<title>添加管理员</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
if session("flag")>1 then
response.write "<br><p align=center>您没有操作的权限</p>"
response.end
end if
if Request("action") = "reg" then
UserName = Strcheck(Request.Form("UserName"))
newpin = Strcheck(Request.Form("newpin"))
re_newpin = Strcheck(Request.Form("re_newpin"))
flag = Request.Form("flag")
Sql = "Insert into admin(username,password,flag)values("& username &","& newpin &","& flag &")"
conn.execute(Sql)
Response.Write "<script>alert(""操作成功"");window.close();window.opener.location.reload();</script>"
Response.End
end if
%>
<script language=javascript>
function check()
{
if(document.form1.username.value=="")
{
alert("用户名为空");
return false;
}
if(document.form1.newpin.value=="")
{
alert("密码不能为空");
return false;
}
if((document.form1.newpin.value)!=(document.form1.re_newpin.value))
{
alert("密码不匹配");
return false;
}
}
</script>
<form method="post" action="?action=reg" name="form1" onsubmit="return check();">
<table width="100%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr bgcolor="#CCCCCC">
<td height="25" bgcolor="#FFCC00" colspan="2">
<div align="center">新增管理员</div>
</td>
</tr>
<tr>
<td height="30" width="30%">用 户 名</td>
<td height="30" width="70%">
<div align="center">
<input type="text" name="username" class="smallInput">
</div>
</td>
</tr>
<tr>
<td height="30" width="30%">初始密码</td>
<td height="30" width="70%">
<div align="center">
<input type="password" name="newpin" class="smallInput">
</div>
</td>
</tr>
<tr>
<td height="30" width="30%">确认密码</td>
<td height="30" width="70%">
<div align="center">
<input type="password" name="re_newpin" class="smallInput">
</div>
</td>
</tr>
<tr>
<td height="30" width="30%">权限设置</td>
<td height="30" width="70%">
<div align="center">
<input type="radio" name="flag" value="3">
录入员
<input type="radio" name="flag" value="2" checked>
编辑员
<input type="radio" name="flag" value="1">
管理员</div>
</td>
</tr>
<tr>
<td height="30" valign="middle" align="center" colspan="2">
<input type="submit" name="Submit" value="确定" class="buttonface">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -