asp简单的用户登陆代码
<%
username=replace(request.form("username"),"'","''")
password=replace(request.form("password"),"'","''")
sql="select * from admin where(username='"&username&"' and password='"&password&"')"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
rs.close
conn.close
session("check")="checked"
response.Redirect "index.asp"
else
session("check")=""
response.write ("对不起,帐号或密码错误,请返回重新输入!")
end if
%>
<p align="center"><a href="login.asp">
<span style="font-size: 9pt; text-decoration: none">返回重新登陆</span></a></p>
时间: 2024-10-25 18:43:42