<meta http-equiv=
"Content-Type"
c type=
"text/css"
href=
"%5Ccss%5Ca.css"
>
<style type=
"text/css"
>
<!--
#main{
font-family:宋体;
font-size:10pt;
text-align:center;
margin-top:510px;
}
body{
background-attachment:fixed;
background-position:center;
background-image:url(./images/w2.jpg);
background-repeat: no-repeat;
}
#authCode{background-Color:#F8F9FF;}
table{text-align:center;}
</style>
<script type=
"text/javascript"
src=
"./js/trim.js"
></script>
<script type=
"text/javascript"
>
<!--
function
clearX(){
document.getElementById(
'authCode'
).value=
""
;
}
function
getVCode() {
var
vcode=document.getElementById(
'vcode'
);
vcode.src =
'yz.php?nocache='
+
new
Date
().getTime();
}
var
xmlHttp;
function
createXmlHttpRequest(){
var
xmlHttp=null;
try
{
xmlHttp=
new
XMLHttpRequest();
}
catch
(e){
try
{
xmlHttp=
new
ActiveXObject(
"Msxml2.XMLHTTP"
);
}
catch
(e){
xmlHttp=
new
ActiveXObject(
"Microsoft.XMLHTTP"
);
}
}
return
xmlHttp;
}
function
login(){
var
authCode=trim(document.getElementById(
'authCode'
).value);
var
username=trim(document.getElementById(
'username'
).value);
var
password=trim(document.getElementById(
'password'
).value);
if
(username==
""
|| password==
""
|| authCode==
""
){
alert(
"请输入用户名和密码和验证码!"
);
return
false;
}
else
{
if
(!xmlHttp) xmlHttp=createXmlHttpRequest();
var
send_string=
"username="
+username+
"&password="
+password+
"&authCode="
+authCode+
"&fresh="
+Math.random();
xmlHttp.open(
"POST"
,
"loginCheck.php"
,true);
xmlHttp.setRequestHeader(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
xmlHttp.send(send_string);
xmlHttp.
if
(xmlHttp.readystate==4 && xmlHttp.status==200){
var
answer=xmlHttp.responseText;
if
(answer==
"ok"
)
window.location.href=
"adminCenter.php"
;
else
{
alert(
"用户名密码或验证码不正确! 请重新输入!"
);
document.getElementById(
'username'
).focus();
}
}
}
}
}
</script>