当前位置:编程学习 > asp >>

asp简单的用户登陆代码

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>

补充:asp教程,ASP入门
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,