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

📄 users.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
'
''''''''''''''''''''''''''''''''''''''''''''
'程序创建时间:14:17 2001-8-18
'程序完成时间:
'最后修改时间:
if session("adminflag")="" then Response.Redirect "default.asp"
dim action,id,name,url,click,isUse
action=request("action")

const thisprog="users.asp"
dim sqlfenye,txtitle
txtitle=request("searchtxt")
if txtitle<>"" then
  sqlfenye="select * from admin where name like '%"&trim(txtitle)&"%' order by id desc"
else
  sqlfenye="select * from admin order by id desc"
end if
Sub deleteid(id)
  conn.execute "delete from admin where id="&cstr(id)
End sub
Sub isUseid(id)
  conn.execute "update admin set isUse=True where id="&cstr(id)
End Sub
Sub notisUseid(id)
  conn.execute "update admin set isUse=False where id="&cstr(id)
End Sub
%>
<!--#include file=base.asp-->
<!--#include file=subs.asp-->
<%
if session("adminflag")<>1 then Call PrintMsg(NotAdmin)

if action="" then action="fenye"
if action="savemod" then
  Call saveuser
elseif action="mod" then
  Call moduser
else
  Call fenye
end if
%>
<!--#include file=end.asp-->

<%
Sub moduser
rSub.open "select * from admin where id="&request("id"),conn,1,1
%>
<form method="post" action=<%=thisprog%>?action=savemod&id=<%=request("id")%>>
<table width="80%" border="0" cellspacing="1" cellpadding="3"  align=center bordercolor=#777777>
  <tr bgcolor=#EEEEEE> 
    <td height="23" colspan="2" ><font color=#000000><b>修改用户资料</b></font>(以下各空请不要超过30字符)</td>
  </tr>
  <tr> 
    <td width="41%" height="18">用户名</td>
    <td width="59%" height="18"> 
      <input type="text" name="name" size="20" value=<%=rSub("name")%>>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">密码</td>
    <td width="59%" height="18"> 
      <input type="text" name="password" size="20" value=<%=rSub("password")%>>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">邮件地址</td>
    <td width="59%" height="18"> 
      <input type="text" name="useremail" size="20" value=<%=rSub("useremail")%>>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">用户等级</td>
    <td width="59%" height="18">
<select name="adminflag">
<%
for i=1 to 4
if rSub("adminflag")=i then
 response.write "<option value="&i&" selected>"&i&"</option>"
else
 response.write "<option value="&i&">"&i&"</option>"
end if
next
%>
</select>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">是否有效</td>
    <td width="59%" height="18">
<input type="checkbox" name="isUse" value="<%=rSub("isUse")%>" <%if rSub("isUse") then response.write "checked"%>>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">注册时间</td>
    <td width="59%" height="18"> 
      <input type="text" disabled size="20" value=<%=rSub("addate")%>>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">最后登录时间</td>
    <td width="59%" height="18"> 
      <input type="text" disabled size="20" value=<%=rSub("lastdate")%>>
    </td>
  </tr>
  <tr> 
    <td width="41%" height="18">登录次数</td>
    <td width="59%" height="18"> 
      <input type="text" disabled size="20" value=<%=rSub("logins")%>>
    </td>
  </tr>
  <tr bgcolor=#EEEEEE> 
    <td height="23" colspan="2" ><input type="hidden" name="oldname" value="<%=rSub("name")%>"><input type="submit" value="提 交"> <input type="reset" value="重 填"></td>
  </tr>
</table>
</form>
<%End Sub

Sub saveuser()
name=Trim(Request("name"))
password=Trim(Request("password"))
useremail=Trim(Request("useremail"))
oldname=Trim(Request("oldname"))
isUse=trim(request("isUse"))
adminflag=Trim(Request("adminflag"))
if name<>oldname then
    rSub.Open "select * from admin where name='"&name&"'",conn,1,1
    if not rSub.eof then Call PrintMsg("该用户名已经存在!")
    rSub.close
end if
    rSub.open "select * from admin where name='"&oldname&"'",conn,1,3
    rSub("name")=name
    rSub("password")=password
    rSub("useremail")=useremail
    rSub("adminflag")=adminflag
    if isUse="" then
      rSub("isUse")=False
    else
      rSub("isUse")=True
    end if
    if rSub("id")=session("userid") then session("name")=rSub("name")
    rSub.update
    rSub.close
response.redirect ""&thisprog&"?action=mod&id="&request("id")&""
End Sub
%>

⌨️ 快捷键说明

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