login.php
水富網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),水富網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為水富成百上千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的水富做網(wǎng)站的公司定做!
function login(){
var account=document.getElementById('account');
var password=document.getElementById('password');
if(account.value==""){
alert("請(qǐng)輸入帳號(hào)");
account.focus;
return;
}
if(password.value==""){
alert("請(qǐng)輸入密碼");
password.focus;
return;
}
var xmlHttp;
//創(chuàng)建XMLHttpRequest對(duì)象
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
} else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
xmlHttp.onreadystatechange = function(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
//發(fā)送到服務(wù)器之后返回的消息
document.getElementById('msg').innerHTML=xmlHttp.responseText;
}
}
}
var url="test.php";
var queryString="account=" + account.value;
xmlHttp.open("post",url,true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
xmlHttp.send(queryString);
}
帳號(hào):
|
|
密碼
|
|
test.php
if(isset($_REQUEST['account'])){
echo "get account:".$_REQUEST['account'];
}
?>