六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

權限管理

[摘要]小弟第一次做權限問題,經過很多人的幫助終于作了一個 呵呵 特發布在這里 希望各位大蝦門指教 1:建數據庫 name 用戶名 pwd 密碼 oskey 權限 2:對數據庫操作 添加用戶 <table width="760" border="0" alig...

小弟第一次做權限問題,經過很多人的幫助終于作了一個 呵呵
特發布在這里 希望各位大蝦門指教
1:建數據庫
name 用戶名
pwd 密碼
oskey 權限

2:對數據庫操作 添加用戶
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" height="1">
<tr>
<td bgcolor="#FFFFFF" width="163" height="143" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#000000">
<td><img src="http://www.okasp.com/techinfo/images/dot.gif" width="1" height="1"></td>
</tr>
</table>

<table width="151" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#DFDFDF">
<td width="131" height="2" bgcolor="#FFFFFF" class="unnamed2">
<div align="center" class="unnamed1">&nbsp;增 加 用 戶</div>
</td>
<td width="20" height="2" align="right" valign="bottom" bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <FORM METHOD=POST ACTION="UserADD.asp">
<div align="center">
<table width="98%" border="0" cellpadding="0" cellspacing="5">
<tr>
<td>
<div align="center"><font color="#FFFFFF">用 戶 名: <br>
<input type=text name=UserName2 size="15" class="smallInput">
</font></div>
</td>
</tr>
<tr>
<td>
<div align="center"><font color="#FFFFFF">用 戶 權 限: <br>
<select name="select">
<option value="super">系統管理員</option>
<option value="check">錄入、審核</option>
<option value="input">錄入</option>
</select>
</font></div>
</td>
</tr>
<tr>
<td>
<div align="center"><font color="#FFFFFF">密 碼: <br>
<input type=text name=Passwd2 size="15" class="smallInput">
</font></div>
</td>
</tr>
<tr>
<td>
<div align="center">
<input type=submit value=增加 name="submit" class="smallInput">
<input type="submit" name="Submit" value="取消" class="smallInput">
</div>
</td>
</tr>
</table>
</div>
</FORM></td>
</tr>
</table>
</td>
<td bgcolor="#FFFFFF" width="10" height="143"><img src="http://www.okasp.com/techinfo/images/dot1.gif" width="1" height="1"></td>
<td width="606" height="143" colspan="2" align="right" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><%
SET DATABASE=Server.CreateObject("ADODB.connection")
%>
<p>用戶列表<br><%
rst.open "select * from password ",conn,1
if rst.EOF then
response.write "沒有欄目:("
else
%>

<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td width="8%" bgcolor="#FFFFFF">
<div align="center"><font color="#000000">ID號</font></div>
</td>
<td width="21%" bgcolor="#FFFFFF">
<div align="center"><font color="#000000">用戶名</font></div>
</td>
<td width="18%" bgcolor="#FFFFFF">
<div align="center"><font color="#000000">密碼</font></div>
</td>
<td width="30%" bgcolor="#FFFFFF">
<div align="center"><font color="#000000">權限</font></div>
</td>
<td width="23%" bgcolor="#FFFFFF">
<div align="center"><font color="#000000">刪除</font></div>
</td>
</tr>
<%do while NOT rst.EOF%>
<tr bgcolor="#FFFFFF">
<td width="8%" align="center"><%=rst("id")%></td>
<td width="21%" align="center"><%=rst("name")%></td>
<td width="18%" align="center"><%=rst("Pwd")%></td>
<td width="30%" align="center"><%=rst("oskey")%></td>
<td width="23%" align="center"><font color="#FFFFFF"><a href="userdel.asp?id=<%=rst("id")%>&amp;name=del">刪除</a></font></td>
</tr>
<%
rst.MoveNext
loop
end if
rst.close
%>
</table>
<p>系統管理員: super<br>
錄入、審核員: check<br>
錄入: input</p>
</td>
</tr>
</table>
<div align="center"><br>
<a href="mimi.asp">back </a></div></td>
</tr>
</table>




添加用戶 useradd.asp
<!--#include file="articleconn.asp"-->
<%
dim rs,tsql
dim rst
set rst=server.CreateObject("ADODB.RecordSet")

rst.open "select * from password",conn,3,2
rst.addnew
rst("oskey")=request("select")
rst("name")=request("UserName2")
rst("Pwd")=request("Passwd2")
rst.update
rst.close

response.redirect "usermanage.asp"%>
呵呵 時間原因 刪除的原代碼舊不寫了


3: 很重要的一環就是下面了 各位應看的出來他的作用
chklogin.asp
<!--#include file=articleconn.asp-->
<%
dim rs
name=request.form("Name")
pwd=request.form("pwd")
set rs=server.createobject("adodb.recordset")
rs.open "select * from password where name='" & name & "'",conn,1
if pwd<>rs("pwd") then
response.write "<link rel='stylesheet' type='text/css' href='style.css'>"
response.write "<body bgcolor='#ffffef'>"
response.write "Sorry,請輸入正確的管理員名字和密碼"
else
session("UserName")=RS("name")
session("KEY")=rs("OSKEY")
response.redirect "mimi.asp"
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>


4:下面就是在 你需要加權限的地方加上條件語句了
例如:<%
IF Session("KEY")<>"super"THEN
response.redirect "mimi.asp"
response.end
END IF
%>

<%
IF not(Session("KEY")="super" or session("KEY")="check" or Session("KEY")="input") THEN
response.redirect "login.asp"
response.end
END IF
%>


呵呵 第一次原創文章 還真不習慣 多多提意見呀!


標簽:權限管理 
主站蜘蛛池模板: 中文字幕亚洲一区二区v@在线 | 一二三四高清在线手机视频 | 中文字幕在线免费观看 | 伊人青青视频 | 先锋影音va中文资源 | 亚洲激情在线看 | 亚洲精品第一国产综合高清 | 日韩精品一区二区在线观看 | 伊人黄| 五月婷婷久久综合 | 午夜免费啪在线观看视频网站 | 亚洲视频一区二区在线观看 | 日韩中文一区宇都宫紫苑 | 天天干天天操天天碰 | 日韩视频中文字幕专区 | 色噜噜狠狠色综合欧洲selulu | 特黄特黄一级片 | 色先锋资源站 | 四虎精品在线观看 | 热热影院 | 亚洲国产高清精品线久久 | 热久久久久| 欧美一级日韩 | 亚洲视频男人的天堂 | 日本欧美在线观看 | 欧美一级三级 | 最近手机中文字幕大全首页 | 欧美一卡二卡3卡4卡无卡免费 | 伊人四虎| 亚洲专区区免费 | 亚洲专区欧美专区 | 色无极亚洲影院 | 亚洲v日本v欧美v综合v | 婷婷丁香五月中文字幕 | 日韩视频福利 | 欧美一区综合 | 伊人55影院 | 五月激情丁香婷婷综合第九 | 日本理论片免费观看在线视频 | 天天干天天操天天拍 | 性色视频在线观看 |