深入extjs与php参数交互的详解

前端之家收集整理的这篇文章主要介绍了深入extjs与php参数交互的详解前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="80045" class="copybut" id="copybut80045" onclick="doCopy('code80045')"> 代码如下:

<div class="codebody" id="code80045">


HelloWorld
<Meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript" src="../../ext-4.0.7-gpl/bootstrap.js">
<script type="text/javascript" src="../../ext-4.0.7-gpl/locale/ext-lang-zh_CN.js">
<script type="text/javascript">
Ext.onReady(function(){
var requestConfig = {
url:'loginServer.PHP',//请求的服务器地址
params:{userName:'lowkey',password:'zq19890319'},//请求参数
method : "post",
callback:function(options,success,response) {
var msg=["请求是否成功:","\n",
"服务器返回值:",response.responseText];
Ext.Msg.alert("提示",response.responseText);
}
}
Ext.Ajax.request(requestConfig);
});




<div class="codetitle"><a style="CURSOR: pointer" data="71759" class="copybut" id="copybut71759" onclick="doCopy('code71759')"> 代码如下:
<div class="codebody" id="code71759">
<?PHP
$userName = $_POST["userName"];
$password = $_POST["password"];
$msg = "";
if($userName=="lowkey" && $password=="zq19890319") {
$msg = "登陆成功";
} else {
$msg = "登陆失败";
}
echo($msg);
?>

猜你在找的PHP相关文章