28,406
社区成员
发帖
与我相关
我的任务
分享//AJAX无刷新注册
var url="loginchk.asp?Usercount="+Usercount+"&Userpasswd="+Userpasswd+"&t="+new Date().getTime();
<!--前台登录页面-->
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" /><!--加这句-->
<%
response.charset="GB2312"'-------------------加这句
on error resume next
UserCount=trim(Request("Usercount"))
UserPasswd=trim(Request("Userpasswd"))
if trim(UserCount)="" then
Response.Write"@error:参数传递错误"
Response.End
end if
Set conn=Server.CreateObject("ADODB.Connection")
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("../mydb.mdb")
Conn.Open
if Conn.State <>1 then
set Conn=nothing
Response.Write "@error:后台数据库连接错误!"
Response.End
end if
err.clear'-------------------移到这里
set rs=server.createobject("adodb.recordset")
sql="select * from usermg where UserCount='"&UserCount&"'and UserPasswd='"&UserPasswd&"'"
rs.Open sql,Conn,1,1
if not rs.eof then
ret="YES": session("Usercount")=UserCount
else
ret="NO"
end if
if rs.State <>0 then rs.Close
set rs=nothing
conn.close: set conn=nothing
if err <>0 then Response.Clear : Response.Write "@error:"&err.Description '调试时使用,成功后注释掉或删除
Response.End
%>