最新文章
·用ADSI编程实现IIS中...
·组件对象开发Web应用...
·嵌入式Web视频点播系...
·Remote Scripting进阶...
·重写表格--[js源码]...
·附件:sendmail.asp
·作一个可以直接和浏览...
·ASP中,常用的变量命...
·IMail基础教程(四) 用...
·使用 IIS 5.0 调整 We...
·关于buildDoc函数的一...
·Remote Scripting进阶...
相关文章
·打印出全部服务器变量...
·ADO对象中的常量
·用ASP、VB和XML建立互...
·使用W3 JMail实现邮件...
·版本管利器Visual Sou...
·堵住ASP漏洞
·asp程序权限控制的代...
·浅析ASP内置组件
·我自己写的聊天室源代...
·脚本控制Frame (转)
·带日期标注的日历控件...
·SQL脚本执行的一个奇...
推荐文章
·在ASP中如何访问Novel...
·压缩并修复Access数据...
·在Win98下安装个人Web...
·Dns组件的一些用法
·WebComputing━ADO总...
·在ASP中用EasyMailObj...
·IIs5.0建站点--〉第三...
·动网7.0 里的 UBB 和...
·DateDiff 函数 祥解
·一个BBS的源代码(四)
·一段生成treeview的js...
·动态数组的另一种实现...
  您现在的位置: 休闲居 >> 网络学院 >> 网络编程 >> ASP >> 

网络编程中点击不同记录进行修改,删除不同记录的另一编程思想ASP与数据库的应用
  人气: 【字体:大 中 小】
  发布时间:2007-02-07 08:42:46

如何通过 点击list控件中的某一列使它传递给 一个修改的对话框
QQ: 283989349 E-mail: mjf150080@tom.com 有问题时,
我们可以通过http://www.hustc.mpc.cn 这个论坛,
我的另一个blog http://blog.csdn.net/ma88fa/ 休 闲 居 编 辑

<!--#include file="conn.asp"-->
<%
if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")>1 then
response.write "<br><p align=center>您没有操作的权限</p>"
response.end
end if
end if

dim rs, sql
%>
<html>
<head>
<title>用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<%
Set rs=Server.CreateObject("Adodb.RecordSet")

sql="select * from admin where flag>="&Session("flag")&" order by id"

rs.Open sql,conn,1,1
%>
<body>
<center>
<p>修改管理员信息 | <a href=adduser.asp>增加管理员</a></p>

<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr align="center" class="title">
<td width="120">用户名</td>
<td width="120">密码</td>
<td width="100">权限</td>
<td width="130">操作</td>
</tr>
</table>
<table width="600" height="15" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<%while not rs.EOF %>
<%if (rs("flag")>Session("flag")) or (rs("username")=Session("admin")) then%>

<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form method="post" action="saveuser.asp" style="margin:0">
<tr align="center">
<td width="120" height="30">
<input class="input" type="text" name="manager" value="<%=rs("username")%>" size="12"></td>
<td width="120" height="30">
<input class="input" type="password" name="newpin" value="<%=rs("password")%>" size="12"></td>
<td width="100" height="30">
<%if rs("flag")=1 then%>
超级用户
<%end if%>
<%if rs("flag")=2 then%>
普通用户
<%end if%>
<%if rs("flag")=3 then%>
员工
<%end if%></td>
<td width="130" height="30">
<input class="button" type="submit" name="Submit" value="修改">
<input class="button" type="submit" name="Submit" value="删除">
<input type="hidden" name="oldmanager" value="<%=rs("username")%>">
<input type="hidden" name="oldpin" value="<%=rs("password")%>"></td>
</tr></form>
</table>
<table width="600" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<%else%>
<table width="600" height="15" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>

<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr align="center" bgcolor="#EBEBEB">
<td width="120" height="30"> <%=rs("username")%></td>
<td width="120" height="30">******</td>
<td width="100" height="30">
<%if rs("flag")=1 then%>
超级用户
<%else%>
普通用户
<%end if%></td>
<td width="130" height="30"></td>
</tr>
</table>
<table width="600" height="15" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<%
end if

rs.MoveNext

Wend
%>
<%
rs.Close
set rs=Nothing

conn.Close
set conn=Nothing
%>
超级用户可以进行所有功能的操作<br>普通用户没有用户管理和栏目管理权限,用户只有添加程序的权限。
</center>
</body>
</html>


≡ 查看、发表评论 ≡