管理员登录界面
paper51.com
图11管理员登陆(admin.asp) copyright paper51.com 对输入的用户名和密码进行判断代码页面 login.asp: paper51.com <%Response.Buffer=True%> 内容来自www.paper51.com <% http://www.paper51.com '查看有无该用户 内容来自论文无忧网 www.paper51.com
dim db,strsql,rs http://www.paper51.com set db=server.createobject("ADODB.connection") paper51.com db.open"dbq="&server.mappath("userinfo.mdb")&";driver={microsoftaccess driver (*.mdb)};" copyright paper51.com strSql="Selectuser_name,password,user_type From users" 内容来自www.paper51.com strSql=strSql & " Whereuser_name='" & Request.Form("user_name") & "' Andpassword='" & Request.Form("password") & "'" 内容来自论文无忧网 www.paper51.com Set rs=db.Execute(strSql) paper51.com If not rs.eof and not rs.bof Then http://www.paper51.com '如果有记录,表示有该用户,则将用户名和用户类型保存到Session中 paper51.com
Session("user_name")=rs("user_name") copyright paper51.com
session("user_type")=rs("user_type") 内容来自论文无忧网 www.paper51.com Session("password")=rs("password") copyright paper51.com '如果是普通用户,重定向到首页;如果是管理员,重定向到管理员页面 内容来自论文无忧网 www.paper51.com IfSession("user_type")="A" Then paper51.com Response.Redirect"houtai.asp" 内容来自www.paper51.com
ELse 内容来自www.paper51.com Response.Redirect"houtai2.asp" paper51.com EndIf 内容来自www.paper51.com Else paper51.com '如果没有记录,表示没有该用户,请给出提示信息 内容来自www.paper51.com Response.Write"对不起,用户名或密码有误,请<a href='admin.asp'>返回</a>重新登录" http://www.paper51.com End If copyright paper51.com %> copyright paper51.com 后台界面 http://www.paper51.com
内容来自论文无忧网 www.paper51.com
图12超级管理员后台界面(houtai.asp) 内容来自www.paper51.com
内容来自www.paper51.com
图13普通管理员后台界面(houtai.asp) paper51.com 内容来自论文无忧网 www.paper51.com 图13普通用户管理员后台界面(user.asp) 内容来自www.paper51.com 附录源码: 内容来自www.paper51.com
超级管理员后台界面(houtai.asp) 内容来自www.paper51.com
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%> paper51.com
<!--#includefile="Connections/coon.asp" --> copyright paper51.com
<% 内容来自www.paper51.com ' *** Edit Operations: declarevariables copyright paper51.com
Dim MM_editAction http://www.paper51.com
Dim MM_abortEdit http://www.paper51.com
Dim MM_editQuery copyright paper51.com Dim MM_editCmd copyright paper51.com Dim MM_editConnection paper51.com Dim MM_editTable 内容来自www.paper51.com Dim MM_editRedirectUrl 内容来自www.paper51.com
Dim MM_editColumn 内容来自论文无忧网 www.paper51.com Dim MM_recordId paper51.com Dim MM_fieldsStr 内容来自www.paper51.com
Dim MM_columnsStr copyright paper51.com Dim MM_fields paper51.com Dim MM_columns copyright paper51.com Dim MM_typeArray http://www.paper51.com Dim MM_formVal 内容来自www.paper51.com
Dim MM_delim copyright paper51.com Dim MM_altVal 内容来自论文无忧网 www.paper51.com Dim MM_emptyVal 内容来自论文无忧网 www.paper51.com Dim MM_i 内容来自www.paper51.com MM_editAction =CStr(Request.ServerVariables("SCRIPT_NAME")) copyright paper51.com If (Request.QueryString <>"") Then copyright paper51.com MM_editAction = MM_editAction & "?" &Server.HTMLEncode(Request.QueryString) copyright paper51.com End If 内容来自www.paper51.com
' boolean to abort record edit 内容来自论文无忧网 www.paper51.com MM_abortEdit = false 内容来自www.paper51.com
' query string to execute 内容来自论文无忧网 www.paper51.com MM_editQuery = "" 内容来自论文无忧网 www.paper51.com %> 内容来自www.paper51.com <% copyright paper51.com ' *** Insert Record: set variables http://www.paper51.com
If(CStr(Request("MM_insert")) = "3") Then 内容来自论文无忧网 www.paper51.com
MM_editConnection = MM_coon_STRING copyright paper51.com MM_editTable = "xinwen" 内容来自www.paper51.com MM_editRedirectUrl = "yjxw.asp" paper51.com MM_fieldsStr ="1|value|2|value" 内容来自www.paper51.com MM_columnsStr = "biaoti|',none,''|meirong|',none,''" copyright paper51.com ' create the MM_fields and MM_columns arrays copyright paper51.com MM_fields = Split(MM_fieldsStr,"|") 内容来自www.paper51.com MM_columns = Split(MM_columnsStr,"|") copyright paper51.com ' set the form values paper51.com For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 http://www.paper51.com MM_fields(MM_i+1) =CStr(Request.Form(MM_fields(MM_i))) paper51.com Next paper51.com ' append the query string to the redirect URL 内容来自www.paper51.com
If (MM_editRedirectUrl <> "" And Request.QueryString<> "") Then 内容来自论文无忧网 www.paper51.com
If (InStr(1,MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString<> "") Then copyright paper51.com MM_editRedirectUrl = MM_editRedirectUrl & "?" &Request.QueryString copyright paper51.com Else http://www.paper51.com MM_editRedirectUrl = MM_editRedirectUrl & "&" &Request.QueryString 内容来自论文无忧网 www.paper51.com End If copyright paper51.com End If paper51.com End If copyright paper51.com %> paper51.com |