您好,登錄后才能下訂單哦!
login.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link type="text/css" href="app.css" rel="stylesheet">
<meta name="viewport" content="width=device-width; initial-scale=1.4; minimum-scale=1.0; maximum-scale=2.0"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<script type="text/javascript" language="JavaScript">
function login(){
var account=document.getElementById('account');
var password=document.getElementById('password');
if(account.value==""){
alert("請輸入帳號");
account.focus;
return;
}
if(password.value==""){
alert("請輸入密碼");
password.focus;
return;
}
var xmlHttp;
//創建XMLHttpRequest對象
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){
//發送到服務器之后返回的消息
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);
}
</script>
</head>
<body >
<div class="appList" >
<table border="0" cellpadding="1" cellspacing="1" bordercolor="#AA7E7B">
<tr>
<td>
帳號:
</td>
<td>
<input id="account" type="text" maxlength="100" /><br/>
</td>
</tr>
<tr>
<td>
密碼
</td>
<td>
<input id="password" type="password" maxlength="100" />
</td>
</tr>
</table>
<input type="button" value="登錄" onclick="login()"/>
<div id="msg"></div>
</div>
</body>
</html>
test.php
<?php
if(isset($_REQUEST['account'])){
echo "get account:".$_REQUEST['account'];
}
?>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。