问题描述:
程序如下:
..........
<%
dim rs1,rs2
dim sql1,sql2
If Request.Form("ok")="确定新增" Then
admin_name=request("admin_name")
admin_flag=request("admin_flag")
admin_password=md5(request("admin_password"))
End If
If request("action")="add" Then
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "jjh_admin",conn,3,3
rs1.addnew
rs1("admin_name")=admin_name
rs1("admin_flag")=admin_flag
rs1("admin_password")=admin_password
rs1.update
rs1.close
response.Redirect("zl.asp")
end if
%>
<% if request("type")="edit" then
if request.querystring("admin_id")="" then
errmsg=errmsg+"<br>"+"<li>请指定操作的对象!"
call diserror()
response.end
else
if not isinteger(request.querystring("admin_id")) then
errmsg=errmsg+"<br>"+"<li>非法的新闻ID参数!"
call diserror()
response.end
end if
end if
sql2="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql2,conn,1,1
%>
<form name="form1" method="post" action="zl.asp?action=edit&admin_id=<%=rs2("admin_id")%>">
<table width="67%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#cccccc">
<tr bgcolor="#E7E7E7">
<td colspan="2"><div align="center">密码修改</div></td>
</tr>
<tr bgcolor="#F6F6F6">
<td width="19%" height="34">管理员姓名</td>
<td width="81%"><input name="admin_user" type="text" class="bottom" value="<%=rs2("admin_name")%>">
</td>
</tr>
<tr bgcolor="#F6F6F6">
<td>管理员密码</td>
<td><input name="admin_pws" type="password" class="bottom" value="<%=rs2("admin_password")%>"></td>
</tr>
<tr bgcolor="#F6F6F6">
<td>管理权限</td>
<td><input type="radio" name="admin_flag" <%if rs2("admin_flag")=1 then response.write "checked" end if%> value="1">
超级管理员
<input type="radio" name="admin_flag" <%if rs2("admin_flag")=2 then response.write "checked" end if%> value="2">
一般管理员 </td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2" > <input type="submit" name="okla" value="确定修改" class="bottom">
</td>
</tr>
<tr bgcolor="#F6F6F6">
<td colspan="2"></td>
</tr>
</table>
</form>
<%
rs2.close
set rs2=nothing
End If %>
<%
dim rs3,rs4,rs5
dim sql3,sql4,sql5
if request.form("okla")="确定修改" then
admin_name=request("admin_name")
admin_flag=request("admin_flag")
admin_password=md5(request("admin_password"))
End If
If request("action")="edit" Then
set rs3=server.CreateObject("adodb.recordset")
sql3="select * from jjh_admin where admin_id="&cint(request.querystring("admin_id"))
rs3.open sql3,conn,3,3
rs3("admin_name")=admin_name
rs3("admin_flag")=admin_flag
rs3("admin_password")=admin_password
rs3.update
rs3.close
response.Redirect("zl.asp")
end if
%>
.........
问题解答:
在asp+access网中,后台修改用户名和密码时用户名和密码不用传到库中.这个旅游问答期待您的解答,请登录账号或关注微信公众号回答这个问题。