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

📄 adminfo.asp

📁 用asp实现的通用网站管理系统。
💻 ASP
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
'  TXSite / 通用网站系统
'
'  版本    :v1.8.20
'
'  制作人  :milp(milp@21cn.com)
'
'  版权所有:源码之家(http://www.21tx.com)
'
'  主页地址:http://www.21tx.com
'            http://www.bestnets.net
'            http://www.soucn.com
'
'  技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
'程序名称:管理员登陆名和密码修改程序
'程序作用:修改管理的登陆名和密码
'程序创建时间:18:54 2001-8-5
'程序完成时间:21:19 2001-8-5
'最后修改时间:21:19 2001-8-5
if session("adminflag")="" then Response.Redirect "default.asp"
const thisprog="adminfo.asp"
%>
<!--#include file=base.asp-->
<!--#include file=char.asp-->
<%
if request("action")="update" then
  call update()
else
  rs.open "select * from admin where id="&session("userid"),conn,1,1
%>
<table width="100%" border="0" cellspacing="3" cellpadding="0">
  <tr>
    <td bgcolor=#EEEEEE> 
      <p><b>个人资料修改</b>:<br>
        注意:这里将修改你的登陆名和密码,修改后请记住新用户和密码。</p>
    </td>
  </tr>
  <tr><td><br><p><b><font color=red><%=request("msg")%></b></font></p>
<form action="adminfo.asp?action=update" method=post>
<input type=hidden name="oldname" value="<%=rs("name")%>">
用户名:<input type=text name="name" value="<%=rs("name")%>"><br>
密 &nbsp;码:<input type=text name="password" value="<%=rs("password")%>"><br>
E-mail:<input type=text name="useremail" value="<%=rs("useremail")%>"><br>
<input type="submit" name="Submit" value="更新"></form></td></tr>
<%rs.close
end if%>
<!--#include file=end.asp-->

<%
sub update()
dim name,password,useremail
name=trim(request("name"))
password=trim(request("password"))
useremail=trim(request("useremail"))
if name="" then
OutMsg=OutMsg+"<br>"+"<li>请输入用户名。"
founderr=true
end if
if password="" then
OutMsg=OutMsg+"<br>"+"<li>请输入密码。"
founderr=true
end if
if not IsValidEmail(useremail) then
OutMsg=OutMsg+"<br>"+"<li>请输入一个合法的邮箱地址。"
founderr=true
end if
if len(name)>30 or len(password)>30 or len(useremail)>30 then
OutMsg=OutMsg+"<br>"+"<li>各空请不要超过30字符。"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
if name<>request("oldname") then
 rSub.open "select * from admin where name='"&name&"'",conn,1,1
 if not (rSub.eof and rSub.bof) then
  rSub.close
  OutMsg=OutMsg+"<br>"+"<li>该用户名已存在,请使用其他用户名。"
  Call PrintMsg(OutMsg)
 end if
 rSub.close
end if
  rSub.open "select * from admin where id="&session("userid")&"",conn,1,3
if rSub("name")="test" then
 rSub.close
 PrintMsg("<li>测试用户不能更改资料。")
end if
  rSub("name")=name
  rSub("password")=password
  rSub("useremail")=useremail
  session("name")=rSub("name")
  rSub.update
  rSub.close
  rSub.open "select addname from main where addname='"&request("oldname")&"'",conn,1,3
  if not (rSub.eof and rSub.bof) then
   do while not rSub.eof
    rSub("addname")=name
    rSub.update
    rSub.movenext
   loop
  end if
  rSub.close
  response.redirect ""&thisprog&"?msg=操作成功!"
end sub
%>

⌨️ 快捷键说明

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