无刷新登录代码Word下载.docx
《无刷新登录代码Word下载.docx》由会员分享,可在线阅读,更多相关《无刷新登录代码Word下载.docx(7页珍藏版)》请在冰豆网上搜索。
![无刷新登录代码Word下载.docx](https://file1.bdocx.com/fileroot1/2022-11/15/3b00eadb-1ace-4f23-8457-3d2b5416f5d5/3b00eadb-1ace-4f23-8457-3d2b5416f5d51.gif)
body{
margin-left:
0px;
margin-top:
margin-right:
margin-bottom:
background-color:
#016aa9;
overflow:
hidden;
}
.STYLE1{
color:
#000000;
font-size:
12px;
-->
/style>
/head>
body>
tablewidth="
100%"
height="
border="
0"
cellpadding="
cellspacing="
tr>
td>
962"
align="
center"
tdheight="
235"
background="
images1/login_01.gif"
&
nbsp;
/td>
/tr>
53"
tdwidth="
394"
images1/login_05.gif"
206"
images1/login_06.gif"
16%"
25"
divalign="
right"
spanclass="
STYLE1"
用户<
/span>
/div>
57%"
inputname="
tname"
text"
id="
style="
width:
105px;
height:
17px;
#292929;
border:
solid1px#7dbad7;
12px;
#6cd0ff"
27%"
密码<
tpwd"
password"
left"
imgsrc="
images1/dl.gif"
width="
49"
18"
cursor:
hand"
onClick="
useAjaxDemo();
"
/table>
362"
images1/login_07.gif"
213"
images1/login_08.gif"
/body>
/html>
Ajax.js页面代码
functionuseAjaxDemo()
{
varajax=createAjaxObject();
sendToValidata();
functioncreateAjaxObject()
{
varajax;
try
ajax=newActiveXObject("
Msxml2.XMLHTTP"
);
}
catch(e)
ajax=newActiveXObject("
Microsoft.XMLHTTP"
ajax=newXMLHttpRequest();
returnajax;
}//使用AJAX对象
functionsendToValidata()
if(!
ajax)
//document.getElementById("
msg"
).innerText="
浏览器不支持使用AJAX技术"
;
alert("
elseif(document.getElementById("
).value=="
){
alert("
用户不能为空!
document.getElementById("
).focus();
密码不能为空!
else
varurl="
Chkadmin.asp?
nick="
+document.getElementById("
).value+"
password="
).value;
ajax.open("
get"
url,true);
ajax.setRequestHeader("
cache-control"
"
no-cache"
application/x-www-form-urlencoded"
ajax.onreadystatechange=result;
ajax.send(null);
functionresult()
if(ajax.readyState==4)
varreword=ajax.responseText;
if(reword=="
1"
window.location="
manage.asp"
//ajax.open("
post"
true);
else{
用户名或密码不正确!
Chkadmin.asp页面代码
%
Response.CharSet="
gb2312"
Response.ContentType="
text/xml"
%>
--#includefile="
../inc/md5.asp"
%dbdns="
../"
../inc/conn.asp"
dimsql
dimrs
dimfrom1
dimsq12
dimsq123
dimnick
dimpassword
nick=replace(trim(request("
nick"
)),"
'
)
password=md5(replace(trim(Request("
))
regjm=replace(trim(Request("
regjm"
)
txt_check=replace(trim(Request("
txt_check"
--------------------企业过期数据检查------------------------
setrs=server.createobject("
adodb.recordset"
sql="
select*fromxyz_yp"
rs.opensql,conn,1,3
dowhilenotrs.eof
ifcdate(year(rs("
xyz_ktdate"
))&
-"
month(rs("
day(rs("
)))<
=date()then
rs("
xyz_key"
)=2
else
ifrs("
)=2then
)=1
endif
rs.update
rs.movenext
loop
rs.close
setrs=nothing
--------------------------------------------
setrs=server.createobject("
sql="
select*fromxyz_adminwherexyz_password='
password&
andxyz_nick='
nick&
rs.opensql,conn,1,1
ifnot(rs.bofandrs.eof)then
ifpassword=rs("
xyz_password"
)then
session("
admin"
)=rs("
xyz_nick"
adminflag"
xyz_flag"
response.Write("
response.End()
else
callError
endif
else
callError()
endif
subError()
response.Write("
登陆失败"
Response.End
endsub
rs.close
conn.close
setrs=nothing
setconn=nothing