无刷新登录代码.docx

上传人:b****3 文档编号:2816591 上传时间:2022-11-15 格式:DOCX 页数:7 大小:15.85KB
下载 相关 举报
无刷新登录代码.docx_第1页
第1页 / 共7页
无刷新登录代码.docx_第2页
第2页 / 共7页
无刷新登录代码.docx_第3页
第3页 / 共7页
无刷新登录代码.docx_第4页
第4页 / 共7页
无刷新登录代码.docx_第5页
第5页 / 共7页
点击查看更多>>
下载资源
资源描述

无刷新登录代码.docx

《无刷新登录代码.docx》由会员分享,可在线阅读,更多相关《无刷新登录代码.docx(7页珍藏版)》请在冰豆网上搜索。

无刷新登录代码.docx

无刷新登录代码

无刷新登录

Index.asp页面代码

//www.w3.org/1999/xhtml">

企业信息管理系统_用户登录

--

body{

margin-left:

0px;

margin-top:

0px;

margin-right:

0px;

margin-bottom:

0px;

background-color:

#016aa9;

overflow:

hidden;

}

.STYLE1{

color:

#000000;

font-size:

12px;

}

-->

 

 

用户

105px;height:

17px;background-color:

#292929;border:

solid1px#7dbad7;font-size:

12px;color:

#6cd0ff">

 

密码

105px;height:

17px;background-color:

#292929;border:

solid1px#7dbad7;font-size:

12px;color:

#6cd0ff">

 

 

Ajax.js页面代码

functionuseAjaxDemo()

{

varajax=createAjaxObject();

sendToValidata();

functioncreateAjaxObject()

{

varajax;

try

{

ajax=newActiveXObject("Msxml2.XMLHTTP");

}

catch(e)

{

try

{

ajax=newActiveXObject("Microsoft.XMLHTTP");

}

catch(e)

{

ajax=newXMLHttpRequest();

}

}

returnajax;}//使用AJAX对象

functionsendToValidata()

{

if(!

ajax)

{

//document.getElementById("msg").innerText="浏览器不支持使用AJAX技术";

alert("浏览器不支持使用AJAX技术");

}

elseif(document.getElementById("tname").value==""){

alert("用户不能为空!

");

document.getElementById("tname").focus();

}

elseif(document.getElementById("tpwd").value==""){

alert("密码不能为空!

");

document.getElementById("tpwd").focus();

}

else

{

varurl="Chkadmin.asp?

nick="+document.getElementById("tname").value+"&password="+document.getElementById("tpwd").value;

ajax.open("get",url,true);

ajax.setRequestHeader("cache-control","no-cache");

ajax.setRequestHeader("Content-Type","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","manage.asp",true);

}

else{

alert("用户名或密码不正确!

");

document.getElementById("tname").focus();

}

}

}

}

 

Chkadmin.asp页面代码

 

<%

Response.CharSet="gb2312"

Response.ContentType="text/xml"

%>

--#includefile="../inc/md5.asp"-->

<%dbdns="../"%>

--#includefile="../inc/conn.asp"-->

<%

dimsql

dimrs

dimfrom1

dimsq12

dimsq123

dimnick

dimpassword

nick=replace(trim(request("nick")),"'","")

password=md5(replace(trim(Request("password")),"'",""))

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("xyz_ktdate"))&"-"&day(rs("xyz_ktdate")))<=date()then

rs("xyz_key")=2

else

ifrs("xyz_key")=2then

rs("xyz_key")=1

endif

endif

rs.update

rs.movenext

loop

rs.close

setrs=nothing

'--------------------------------------------

setrs=server.createobject("adodb.recordset")

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")

session("adminflag")=rs("xyz_flag")

response.Write("1")

response.End()

else

callError

endif

else

callError()

endif

subError()

response.Write("登陆失败")

Response.End

endsub

rs.close

conn.close

setrs=nothing

setconn=nothing

%>

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 自然科学 > 数学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1