熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> PHP編程 >> 正文

深入extjs與php參數交互的詳解

2013-11-15 12:37:13  來源: PHP編程 
代碼如下:
<html>
<head>
<title>HelloWorld</title>
<meta httpequiv="ContentType" content="text/html; charset=utf">
<link rel="stylesheet" type="text/css" href="//extgpl/resources/css/extallcss" >
<script type="text/javascript" src="//extgpl/bootstrapjs"></script>
<script type="text/javascript" src="//extgpl/locale/extlangzh_CNjs"></script>
<script type="text/javascript">
ExtonReady(function(){
var requestConfig = {
url:loginServerphp //請求的服務器地址
params:{userName:lowkey password:zq} //請求參數
method : "post"
callback:function(options success response) {
var msg=["請求是否成功" success "n"
"服務器返回值" responseresponseText];
ExtMsgalert("提示" responseresponseText);
}
}
ExtAjaxrequest(requestConfig);
});

</script>
</head>

<body>
</body>
</html> 復制代碼代碼如下:
<?php
$userName = $_POST["userName"];
$password = $_POST["password"];
$msg = "";
if($userName=="lowkey" && $password=="zq") {
$msg = "登陸成功";
} else {
$msg = "登陸失敗";
}
echo($msg);
?>
From:http://tw.wingwit.com/Article/program/PHP/201311/21296.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.