asp 添加用户权限 40
IfRequest.form("user")="修改"ThenSetrs=Server.CreateObject("ADODB.RecordSet")Sql="Selec...
If Request.form("user")=" 修 改 " Then
Set rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [user] Where id="&Request("id")&""
rs.Open Sql,Conn,1,3
rs("admin") = Request.form("admin")
if request.form("pwd")<>"" then
if len(request.form("pwd"))<4 then
Response.Write "<script>alert('用户密码不能少于4位!');location='javascript:history.back(-1)'</SCRIPT>"
Response.End
end if
rs("password")=md5(request.form("pwd"))
end if
rs.Update
rs.Close
Response.Write "<script>alert('操作成功!');this.location.href='t_user.asp';</SCRIPT>"
end if
%>
<body>
<table width="100%" border="0" align=center cellpadding="6" cellspacing="0">
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [user] Where id="&Request("id")&""
rs.Open Sql,Conn,1,1
%>
<form action="" method=post name=form1 onSubmit="return chk(this)">
<tr>
<td height=25 colspan=2 align="center" bgcolor="#F9F9F9"><b>修 改 用 户</b></td>
</tr>
<tr>
<td width="40%" align="right">用 户:</td>
<td width="60%"><b><%=rs("username")%></b></td>
</tr>
<tr>
<td width="40%" align="right">权 限:</td>
<td width="60%"><!--添加用户的权限-->
创始人<input name="admin" type="radio" value="1" <%If rs("admin")=1 Then Response.Write "checked" End if%>/> 主管理员<input name="admin" type="radio" value="1" <%If rs("admin")=2 Then Response.Write "checked" End if%> /> 付费会员<input name="admin" type="radio" value="1" <%If rs("admin")=3 Then Then Response.Write "checked" End if%>/> 注册会员<input name="admin" type="radio" value="0" <%If rs("admin")=4 Then Response.Write "checked" End if%>/>
---------------------------------------------------------------------------------------
<%
If rs("admin")=1 Then
Response.Write "管理员"
end if
If rs("admin")=2 Then
Response.Write "付费会员"
end if
If rs("admin")=3 Then
Response.Write "普通会员"
end if
If rs("admin")=4 Then
Response.Write "注册会员"
End if
%></td>
-----------------------------------------------------------------------------------------
最上面的代码执行不成功 展开
Set rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [user] Where id="&Request("id")&""
rs.Open Sql,Conn,1,3
rs("admin") = Request.form("admin")
if request.form("pwd")<>"" then
if len(request.form("pwd"))<4 then
Response.Write "<script>alert('用户密码不能少于4位!');location='javascript:history.back(-1)'</SCRIPT>"
Response.End
end if
rs("password")=md5(request.form("pwd"))
end if
rs.Update
rs.Close
Response.Write "<script>alert('操作成功!');this.location.href='t_user.asp';</SCRIPT>"
end if
%>
<body>
<table width="100%" border="0" align=center cellpadding="6" cellspacing="0">
<%
Set rs = Server.CreateObject("ADODB.RecordSet")
Sql = "Select * From [user] Where id="&Request("id")&""
rs.Open Sql,Conn,1,1
%>
<form action="" method=post name=form1 onSubmit="return chk(this)">
<tr>
<td height=25 colspan=2 align="center" bgcolor="#F9F9F9"><b>修 改 用 户</b></td>
</tr>
<tr>
<td width="40%" align="right">用 户:</td>
<td width="60%"><b><%=rs("username")%></b></td>
</tr>
<tr>
<td width="40%" align="right">权 限:</td>
<td width="60%"><!--添加用户的权限-->
创始人<input name="admin" type="radio" value="1" <%If rs("admin")=1 Then Response.Write "checked" End if%>/> 主管理员<input name="admin" type="radio" value="1" <%If rs("admin")=2 Then Response.Write "checked" End if%> /> 付费会员<input name="admin" type="radio" value="1" <%If rs("admin")=3 Then Then Response.Write "checked" End if%>/> 注册会员<input name="admin" type="radio" value="0" <%If rs("admin")=4 Then Response.Write "checked" End if%>/>
---------------------------------------------------------------------------------------
<%
If rs("admin")=1 Then
Response.Write "管理员"
end if
If rs("admin")=2 Then
Response.Write "付费会员"
end if
If rs("admin")=3 Then
Response.Write "普通会员"
end if
If rs("admin")=4 Then
Response.Write "注册会员"
End if
%></td>
-----------------------------------------------------------------------------------------
最上面的代码执行不成功 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询