?? check_userlogin.asp
字號:
<!--#include file="conn.asp" -->
<!--#include file="inc/Md5.asp"-->
<%
If Request.QueryString("action")="login" then
dim sql,mRs,username,password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
If username="" then
FoundErr=True
Response.Redirect "user_login.asp"
Response.End
End If
If password="" then
FoundErr=True
Response.Redirect "user_login.asp"
Response.End
End If
If FoundErr<>True then
password=Md5(password)
set mRs=server.createobject("adodb.recordset")
sql="select * from A_admin where username='"&username&"'and password='"&password&"'"
mRs.open sql,conn,1,1
If not(mRs.eof and mRs.bof) then
session("username")=mRs("username")
session("edip")=("username")
response.cookies("yhmc")=mRs("username")
response.Redirect"index.asp"
else
response.cookies("yhmc")=""
Response.Write "<script>alert('帳號或密碼錯誤!');this.location.href='user_login.asp';</SCRIPT>"
End If
End If
End If
%>
<%
'退出
If Request.QueryString("action")="Quit" then
session("username")=""
session("edip")=""
response.cookies("yhmc")=""
Response.Write "<script>alert('已安全退出!');this.location.href='user_login.asp';</SCRIPT>"
End If
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -