check.asp

来自「本人的课程设计。不足之处请大家指教。因为第一次用ASP有很多不足的地方。」· ASP 代码 · 共 34 行

ASP
34
字号
<!-- #include file="conn/conn.asp" -->
<%
set rs=server.createobject("adodb.recordset")
sql="select * from student where id='"&trim(request.form("id"))&"'"
rs.open sql,conn,1,1
if not rs.eof then    '取到记录

	if trim(rs("pwd"))=trim(request.form("pwd")) then   '密码正确
	
	  response.cookies("username")=trim(request.form("id"))
	  response.redirect "queselect.asp"
	
	else
	  %>
		<script>
		window.alert("密码错误!")
		history.go(-1);
		</script>
	  <%
	end if
else   '无记录
%>
<script>
window.alert("不存在该账号!")
history.go(-1);
</script>
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
 

⌨️ 快捷键说明

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