<!--#include file="conn_db.asp"-->
<%
Session.timeout=30'这里强制Session的过期时间为30分钟。
uname=trim(Request.Form("name"))
upassword=trim(Request.Form("password"))
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from [login] where uname='"&uname&"' and upassword='"&upassword&"' "
rs.open sql,conn,1,1
if rs.recordcount=0 then
response.write("<script>alert('数据库中没有这个用户,或者用户名或密码有误!');history.back
();</script>")
else
Session["username"]=uname
response.write("<script>alert('恭喜您,登录成功!
~~');location.href='sdbbsindex.asp';</script>")
end if
rs.close
set rs=nothing
%>
<%
Session.timeout=30'这里强制Session的过期时间为30分钟。
uname=trim(Request.Form("name"))
upassword=trim(Request.Form("password"))
set rs=Server.CreateObject("Adodb.Recordset")
sql="select * from [login] where uname='"&uname&"' and upassword='"&upassword&"' "
rs.open sql,conn,1,1
if rs.recordcount=0 then
response.write("<script>alert('数据库中没有这个用户,或者用户名或密码有误!');history.back
();</script>")
else
Session["username"]=uname
response.write("<script>alert('恭喜您,登录成功!
~~');location.href='sdbbsindex.asp';</script>")
end if
rs.close
set rs=nothing
%>