www.gusucode.com > 深度梦想整站系统(asp) 1.14.02源码程序 > admin/adminUser/adminUser_Update.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <% projectRootPath = "../../" '相对当前应用程序根的位置 %> <!-- #include file="../web.config.asp"--> <!-- #include file="../../Deep_library/Deep.util.md5.asp"--> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="robots" content="noindex,nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <link href="../themes/<%=theme_Path%>/main.css" rel="stylesheet" type="text/css" /> <script language="javascript"> function form1_onsubmit() { if (document.form1.UserName.value=="") { document.form1.UserName.focus(); window.alert("用户名不能为空!!!"); return false; } if (document.form1.password1.value=="" ) { document.form1.password1.focus(); window.alert("用户密码不能为空!!!"); return false; } if (document.form1.password2.value=="") { document.form1.password2.focus(); window.alert("确认密码不能为空!!!"); return false; } if (document.form1.password1.value!= document.form1.password2.value) { document.form1.password1.focus(); window.alert("密码输入不一致!!!"); return false; } } </script> </head> <body > <br /> <a href="adminUser_Manage.asp">用户管理</a> | <a href="adminUser_Add.asp">添加用户</a> <hr color="#0099FF" size="1" /> <br /> <dl class="manageContent"> <dt>用户修改管理</dt> <dd> <br /> <% if Request.Form("UserName")<>"" and Request.Form("password1")<>"" and Request.Form("password2")<>"" and Request.Form("password1")=Request.Form("password2") then UserName=trim(Request.Form("UserName")) password1=MD5(trim(Request.Form("password1")) ,32) 'password2=Request.Form("password2") Purview=Request.Form("Purview") id=request.Form("id") sql_serach="select * from deep_Admin where fuserName='"&UserName&"' " set rsUserSearch=conn.execute(sql_serach) if (rsUserSearch.eof and rsUserSearch.bof) then sql="update deep_Admin set fuserName='"&UserName&"',fpassword='"&password1&"',fpurview='"&Purview&"' where fid="&id conn.execute(sql) response.Write("<p align='center'>用户:["& UserName &"] 修改成功</p>") else 'response.Write( "]"&id &"======"&rsUserSearch("fid") &"[") if(Eval( trim(id)=cstr(rsUserSearch("fid")) ) )then sql="update deep_Admin set fuserName='"&UserName&"',fpassword='"&password1&"',fpurview='"&Purview&"' where fid="&id conn.execute(sql) response.Write("<p align='center'>用户:["& UserName &"] 修改成功</p>") else Response.Write("<p align='center'>["& UserName &"] 已被注册,请注册其它名称</p>") end if 'response.Write("========") end if rsUserSearch.close set rsUserSearch=nothing else id=request.QueryString("ID") Sql="Select * from deep_Admin where fID="& id Set Rs=conn.execute(sql) %> <form id="form1" name="form1" method="post" action="" onsubmit="return form1_onsubmit()"> <table width="60%" border="0" align="center" class="tableBoderForm"> <tr> <td height="30">用户名称:</td> <td><input type="text" name="UserName" value="<%=Rs("fuserName")%>" /> * 必添项</td> </tr> <tr> <td height="30"><p>用户密码:</p> </td> <td><input type="password" name="password1" /></td> </tr> <tr> <td height="30">确认密码:</td> <td><input type="password" name="password2"/></td> </tr> <tr> <td height="30">管理权限:</td> <td><select name="purview" id="purview"> <option value="管理员" selected="selected">管理员</option> </select> </td> </tr> <tr> <td height="30"><input type="hidden" name="id" value="<%=ID%>"/></td> <td><input type="submit" name="Submit" value="修改" /> <input type="reset" name="Reset" value="重置" /></td> </tr> </table> </form><br /> <% Rs.close Set Rs=Nothing end if Call CloseConnDB() %> <br /> </dd> </dl> <br /> </body> </html>