var LoginForm = '\ 用户:\ 密码:\ 验证: \ \ \ '; var xmlhttp=createXMLHttp(); var responsetxt; var username; function chk_login() { var username=document.getElementById("uname").value; var userpass=document.getElementById("upass").value; var postcode=document.getElementById("codestr").value; if (username==""||userpass=="") { dialog("请完整填写用户名和密码!","","",""); return; } if (username.length>14||userpass.length>14) { //dialog("用户名或密码超长!","","block",""); dialog("用户名或密码超长!","","",""); return; } document.getElementById("ShowLogin").innerHTML=' 登陆中.....请稍侯...'; var poststr="username="+username+"&userpass="+userpass+"&postcode="+postcode; xmlhttp.open("Post","Ajax.asp?Action=Login",true); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readystate==4 && xmlhttp.status==200) { responsetxt=unescape(xmlhttp.responseText) Show(); } } xmlhttp.setrequestheader("content-length",poststr.length); xmlhttp.setrequestheader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(poststr); xmlhttp.close; //alert(poststr); //alert(xmlhttp.responseText); } function Show() { if (responsetxt.indexOf("|||")>0) { var userinfo=responsetxt.split("|||") document.getElementById("ShowLogin").innerHTML=""; document.getElementById("ShowLogin").innerHTML=userinfo[0]+",您好! 安全提示 密码修改 资料修改 定单管理 退出系统" }else{ dialog(responsetxt,'','',''); //alert(LoginForm); //document.getElementById("ShowLogin").innerHTML="123"; document.getElementById("ShowLogin").innerHTML=LoginForm; } } function Logout() { //var LoginForm = '\ //
\ // 用户名:\ // 密码:\ // 验证码: \ // \ //
\ //'; document.getElementById("ShowLogin").innerHTML=' 注销中.....请稍侯...'; var xmlhttpp=createXMLHttp(); xmlhttpp.open("Post","Ajax.asp?Action=Logout",true) xmlhttpp.onreadystatechange=function() { if (xmlhttpp.readystate==4 && xmlhttpp.status==200) { //document.getElementById("ShowLogin").style.display="block"; document.getElementById("ShowLogin").innerHTML=LoginForm; //alert(document.cookie); //alert(xmlhttpp.responseText); } } xmlhttpp.send(); xmlhttpp.close; } document.write ('
用户: 密码: 验证:  
');