ASP 大家帮下忙急急急!!1
<!--#includefile="conn.asp"--><%s=Trim(Request.Form("s"))s2=Request.Form("s2")Ifs2<>s...
<!--#include file="conn.asp"-->
<%
s=Trim(Request.Form("s"))
s2=Request.Form("s2")
If s2<>s Then
Response.Write("<script language=javascript>alert('请输入正确的认证码!');history.back()</script>")
Response.End
end if
user=replace(trim(request.form("user")),"'","''")
password=replace(trim(request.form("password")),"'","''")
if instr(user,"%") or instr(user,"#") or instr(user,"?") or instr(user,"|") then
response.write "<script language=javascript>alert('您的姓名含有非法字符!');history.back()</script>"
response.end
end if '====================检测姓名中是否含有非法字符
if instr(password,"%") or instr(password,"#") or instr(password,"?") or instr(password,"|") then
response.write "<script language=javascript>alert('您的密码含有非法字符!');history.back()</script>"
response.end
end if '====================检测密码中是否含有非法字符
sql="select * from admin where admin='"&user&"' and password='"&password&"'"
set rs=conn.execute(sql)
if rs.eof then
Response.Write("<script language=javascript>alert('管理员姓名和密码错误!');history.back()</script>")
Response.End
else
Session("admin")=user
'session("flag")=rs("flag")
Response.Redirect("index1.asp") '=================如果验证成功刚引向管理员页面
end if
conn.close
set conn=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>
登陆后台 回车之后 ——————无法显示网页 展开
<%
s=Trim(Request.Form("s"))
s2=Request.Form("s2")
If s2<>s Then
Response.Write("<script language=javascript>alert('请输入正确的认证码!');history.back()</script>")
Response.End
end if
user=replace(trim(request.form("user")),"'","''")
password=replace(trim(request.form("password")),"'","''")
if instr(user,"%") or instr(user,"#") or instr(user,"?") or instr(user,"|") then
response.write "<script language=javascript>alert('您的姓名含有非法字符!');history.back()</script>"
response.end
end if '====================检测姓名中是否含有非法字符
if instr(password,"%") or instr(password,"#") or instr(password,"?") or instr(password,"|") then
response.write "<script language=javascript>alert('您的密码含有非法字符!');history.back()</script>"
response.end
end if '====================检测密码中是否含有非法字符
sql="select * from admin where admin='"&user&"' and password='"&password&"'"
set rs=conn.execute(sql)
if rs.eof then
Response.Write("<script language=javascript>alert('管理员姓名和密码错误!');history.back()</script>")
Response.End
else
Session("admin")=user
'session("flag")=rs("flag")
Response.Redirect("index1.asp") '=================如果验证成功刚引向管理员页面
end if
conn.close
set conn=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
</body>
</html>
登陆后台 回车之后 ——————无法显示网页 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询