saverification.asp

来自「一个相当不错的考试系统源代码」· ASP 代码 · 共 32 行

ASP
32
字号
<!--#include file="../include/conn2.asp"-->
<!--#include file="md5.asp"-->
<%
	sub ShowMsg(msg)
		msg=server.URLEncode(msg)		'将字符串编码,以便做参数传递
		response.Redirect("salogin.asp?msg=" + msg)
	end sub
dim user,pass,yanzheng
user = request("saname")
pass = request("saps")
pass = MD5(pass)
yanzheng = request("sapsv")
set rs = server.CreateObject("ADODB.RecordSet")
strSQL="select * from admin where saname='" & user &"'"
rs.open strSQL,conn,1,1
if rs.eof then
	ShowMsg("用户名或密码不正确!")
end if
if  trim(rs("sapass"))<>pass then
	ShowMsg("用户名或密码不正确!")
	elseif 	yanzheng <> "fixty" then ShowMsg("验证码不正确!")
end if
    Session("LoginName")=rs("saname")		'账号
    Session("PassWord")=rs("sapass")			'密码
	Session("ID")=rs("ID")
	rs.close
	set rs = nothing
	conn.close
	set conn = nothing
	response.Redirect("default.asp")
%>

⌨️ 快捷键说明

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