45fan.com - 路饭网

搜索: 您的位置主页 > 电脑频道 > 电脑教程 > 阅读资讯:如何使用asp用户登录代码?

如何使用asp用户登录代码?

2016-08-26 12:08:25 来源:www.45fan.com 【

如何使用asp用户登录代码?

function htm_fn(str)
dim result
result = replace(replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),"'",""),chr(34),""),";","")
htm_fn = result
end function

If request("login")<>"" then
if request("valpass")=session("ValidateCode") then
set rs=server.createobject("adodb.Recordset")
sql="select id from lei_member where username='"&htm_fn(request("username"))&"' and password='"&htm_fn(request("password"))&"'"
rs.open sql,conn,3,1
if rs.bof or rs.eof then
response.write"<SCRIPT language=JavaScript>alert('密码不正确或无此用户!');"
response.write"this.location.href='index.asp';</SCRIPT>"
else
session("username")=rs("id")
response.write"<SCRIPT language=JavaScript>alert('登录成功!');</script>"
response.Redirect "member.asp"
end if
rs.close
set rs = nothing
else
response.Write "<script>alert('请正确输入验证码')</script>;
End If


本文地址:http://www.45fan.com/dnjc/67855.html
Tags: 登录 代码 asp
编辑:路饭网
关于我们 | 联系我们 | 友情链接 | 网站地图 | Sitemap | App | 返回顶部