QQ登录界面代码
login.asp:
<form name="login" method="post" action="after_login.asp">
用户名:<input name="user_name" size="12" maxlength="16">密 码:<input name="password" size="12" type="password" maxlength="16">
<input align="absMiddle" id="image1" name="image1" src="images/login.gif" type="image" WIDTH="37" HEIGHT="20">
</form>
coon.asp:
<%
connstr = "DBQ=" + server.mappathuser.mdb") + ";DRIVER={Microsoft Access Driver (*.mdb)}"
Set ateobject("ADODB.CONNECTION")
conn.Open connstr
%>
外加after_login.asp登录验证页面:
<%
Dim UserName,PassWord
qq用户名UserName=replace(trim(Request.Form("Username")),"'","‘")
PassWord=replace(trim(Request.Form("PassWord")),"'","‘")
If UserName="" or PassWord="" Then
Response.Write ("<script>alert('会员登陆失败!\n\n错误原因:会员帐号和密码未填。');history.back();</script>")
d
End If
if Instr(UserName,">")>0 or Instr(UserName,"<")>0 or Instr(UserName,"=")>0 or Instr(UserName,"%")>0 or Instr(UserName,chr(32))>0 or Instr(UserName,"?")>0 or Instr(UserName,"&")>0 or Instr(UserName,";")>0 or Instr(UserName,",")>0 or Instr(UserName,"'")>0 or Instr(UserName,chr(34))>0 or Instr(UserName,chr(9))>0 or Instr(UserName," ")>0 or Instr(UserName,"$")>0 then
Response.Write ("<script>alert('会员登陆失败!\n\n错误原因:会员含有非法字符!');history.back();</script>")
d
else
UserName=Trim(UserName)
end if
set ateobject("dset")
sql="select * from [user] where UserName='"&UserName&"'"
rs.open sql,conn,1,3
f then
Response.Write ("<script>alert('会员登陆失败!\n\n错误原因:会员帐号错误。');history.back();</script>")
d
else
if rs("PassWord")<>PassWord then
rs.close
set rs=nothing
Response.Write ("<script>alert('会员登陆失败!\n\n错误原因:会员密码错误。');history.back();</script>")
d
else
session("UserName")=UserName'登录成功传递一个session值以便以后调用用户相关
session.timeout=300
end if
end if
rs.close
set rs=nothing
CloseDatabase
%>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论