深入extjs與php參數(shù)交互的詳解
更新時間:2013年06月25日 14:40:03 作者:
本篇文章是對extjs與php的參數(shù)交互進行了詳細的分析介紹,需要的朋友參考下
復制代碼 代碼如下:
<html>
<head>
<title>HelloWorld</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../ext-4.0.7-gpl/resources/css/ext-all.css" >
<script type="text/javascript" src="../../ext-4.0.7-gpl/bootstrap.js"></script>
<script type="text/javascript" src="../../ext-4.0.7-gpl/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var requestConfig = {
url:'loginServer.php', //請求的服務(wù)器地址
params:{userName:'lowkey', password:'zq19890319'}, //請求參數(shù)
method : "post",
callback:function(options, success, response) {
var msg=["請求是否成功:", success, "\n",
"服務(wù)器返回值:", response.responseText];
Ext.Msg.alert("提示", response.responseText);
}
}
Ext.Ajax.request(requestConfig);
});
</script>
</head>
<body>
</body>
</html>
復制代碼 代碼如下:
<?php
$userName = $_POST["userName"];
$password = $_POST["password"];
$msg = "";
if($userName=="lowkey" && $password=="zq19890319") {
$msg = "登陸成功";
} else {
$msg = "登陸失敗";
}
echo($msg);
?>
相關(guān)文章

PHP preg_match實現(xiàn)正則表達式匹配功能【輸出是否匹配及匹配值】
這篇文章主要介紹了PHP preg_match實現(xiàn)正則表達式匹配功能,較為詳細的介紹了preg_match函數(shù)的功能、參數(shù)含義、返回值及使用方法,并結(jié)合實例給出了preg_match輸出是否匹配及匹配值的相關(guān)實現(xiàn)技巧,需要的朋友可以參考下
2017-07-07 
PHP 魔術(shù)變量和魔術(shù)函數(shù)詳解
這篇文章主要簡單介紹了PHP 魔術(shù)變量和魔術(shù)函數(shù),以及使用示例,方便我們學習理解php魔術(shù)變量和魔術(shù)函數(shù),有需要的小伙伴參考下吧。
2015-02-02