⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_user_modify.asp

📁 [FIF]ASP互动视频VIP教程 书包
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% Option Explicit %>
<!-- 后台用户管理->修改用户密码 -->
<!-- #include file="../config/db.asp" -->
<!-- #include file="../config/function.inc.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>FIF VIP ASP教程后台管理--用户管理--&gt;修改用户资料</title>
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style></head>

<body>
<%
on error resume next
dim sql,rst,myError
set rst=server.createobject("adodb.recordset")
'修改密码
if request.QueryString("act")="update" then
  if isnumeric(request.querystring("id")) and not isempty(request.querystring("id")) then
    if request.form("f_code")="" then
	  msgboxU "密码不能为空!"
	else
      sql="update tbl_user set u_code='"&request.form("f_code")&"',u_name='" & request.Form("f_name") & "',u_sex='" & request.Form("f_sex") & "',u_tel='" & request.Form("f_tel") & "' where u_id="&request.querystring("id")
	  conn.execute sql
      set myErrors=conn.errors
      if myErrors.count=0 then
	    msgboxU "修改成功!"
	  else
	    msgboxU "修改失败!原因:"&myErrors.item(0).description
	  end if
	end if
  else
    msgboxU "非法的参数!"
  end if
end if
'显示需要修改密码表单
if request.querystring("act")="modify" then
  if isnumeric(request.querystring("id")) and request.querystring("id")<>0 then
	sql="select * from tbl_user where u_id="&request.querystring("id")
	rst.open sql,conn,1,1
	if rst.bof and rst.eof then
	  msgboxU "未找到用户,可能是参数有误!"
	else
%>
<table width="460" height="192" border="1" cellpadding="0" cellspacing="0">
  <form name="form1" method="post" action="admin_user_modify.asp?act=update&id=<%=request.querystring("id")%>">
    <tr>
      <td height="29" colspan="2">用户管理--&gt;修改用户资料</td>
    </tr>
    <tr>
      <td width="149" height="30" align="right">用户名:</td>
      <td width="305"><%=rst("u_user")%></td>
    </tr>
    <tr>
      <td height="13" align="right">密&nbsp; 码:</td>
      <td><input name="f_code" type="text" id="f_code" value="<%=rst("u_code")%>" size="25" maxlength="50"> </td>
    </tr>
    <tr>
      <td height="14" align="right">姓&nbsp; 名:</td>
      <td><input name="f_name" type="text" id="f_name" value="<%=rst("u_name")%>" size="25" maxlength="50"></td>
    </tr>
    <tr>
      <td height="27" align="right">性&nbsp; 别:</td>
      <td><input name="f_sex" type="radio" value="男" checked>
          <input type="radio" name="f_sex" value="女" <% if rst("u_sex")="女" then response.Write "checked" %>>
          女</td>
    </tr>
    <tr>
      <td height="27" align="right">电&nbsp; 话:</td>
      <td><input name="f_tel" type="text" id="f_tel" value="<%=rst("u_tel")%>" size="25" maxlength="50"></td>
    </tr>
    <tr align="center">
      <td height="23" colspan="2"><input type="submit" name="Submit" value="修改用户资料">
&nbsp;
        <input type="reset" name="Submit2" value="重置">      </td>
    </tr>
  </form>
</table>
<%
    end if
  else
    msgboxU "非法的参数!"
  end if
end if
%>
<%
rst.close
set rst=nothing
conn.close
set conn=nothing
%>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -