📄 add_user.asp
字号:
<%
if session("username")="" or session("usertype")="" then
response.Write"<script>"
response.Write"parent.location.href='default.asp';"
response.Write"</script>"
end if
%>
<!--#include file="conn.asp"-->
<%
if request("action")="add" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from net_admin order by id desc"
rs.open sql,conn,3,2
rs.addnew
rs("users")=request("user")
rs("passwd")=request("password")
rs("types")=request("types")
rs.update
rs.close
response.Write("<script>")
response.Write("alert('添加成功!');")
response.Write("window.location.href='add_user.asp';")
response.Write("</script>")
response.End()
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加信息</title>
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=100% align=center border=0>
<TR>
<TD style="HEIGHT: 16px"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="77%"><SPAN class=heading>添加用户</SPAN> </td>
</tr>
</table></TD>
</TR>
<TR>
<TD height=12 colSpan=2><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="#CCCCCC" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></TD>
</TR>
<TR>
<TD height="140" colSpan=2 vAlign=top> <div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#DBDBDB"> <table width="100%" border="0" cellspacing="1" cellpadding="0">
<form method="post" name="post" action="add_user.asp?action=add">
<tr>
<td width="15%" height="25" bgcolor="#FFFFFF"> <div align="right">用户:</div></td>
<td width="1%" rowspan="2" background="images/gline.gif" bgcolor="#FFFFFF"><img src="images/gline.gif" width="8" height="27"></td>
<td width="84%" bgcolor="#FFFFFF"> <input name="user" type="text" class=input_main id="user" style="width:120px;" >
</td>
</tr>
<tr>
<td height="25" bgcolor="#FFFFFF"><div align="right">密码:</div></td>
<td bgcolor="#FFFFFF"><input name="password" type="text" id="password" class=input_main style="width:120px;">
</td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF">级别:</td>
<td background="images/gline.gif" bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="types" id="types">
<option value="0" selected>管理员</option>
<option value="1">超级管理员</option>
</select></td>
</tr>
<tr>
<td height="25" align="right" bgcolor="#FFFFFF"> </td>
<td background="images/gline.gif" bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> <input type="submit" name="Submit" value="提 交" class=sub onClick="return subclick();">
<input type="reset" name="reset" value="重 置" class=sub>
</td>
</tr>
</form>
</table></td>
</tr>
</table>
</div></TD>
</TR>
</TABLE>
</body>
</html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function subclick()
{
if (post.user.value =="")
{
alert("用户名不能为空!");
post.user.focus();
return (false);
}
if (post.password.value =="")
{
alert("密码不能为空!");
post.password.focus();
return (false);
}
}
//-->
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -