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

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

<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', //请求的服务器地址
     params:{userName:'lowkey', password:'zq19890319'}, //请求参数
     method : "post",
     callback:function(options, success, response) {
         var msg=["请求是否成功:", success, "\n",
           "服务器返回值:", 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);
?>

相关文章

php数据结构与算法(PHP描述) 查找与二分法查找

复制代码 代码如下: <?php /** * 查找 * **/ // 顺序查找 function normal_search($arrData,$val) { $len = cou...

php修改文件上传限制方法汇总

PHP默认的上传限定是最大2M,想上传超过此设定的文件,需要调整PHP、apache等的一些参数。下面,我们简要介绍一下PHP文件上传涉及到的一些参数: file_uploads :是否...

Eclipse中php插件安装及Xdebug配置的使用详解

Eclipse中php插件安装及Xdebug配置的使用详解

由于在android开发团队,又迷上了android自动化测试,所有一直使用Eclipse做为开发工具。以前使用Zend Studio 9.0.1做为PHP的开发工具,现在放弃使用Zen...

php中通过DirectoryIterator删除整个目录的方法

本文实例讲述了php中通过DirectoryIterator删除整个目录的方法。分享给大家供大家参考。具体实现方法如下: <?php function cleanup_...

PHP基于单例模式实现的数据库操作基类

本文实例讲述了PHP基于单例模式实现的数据库操作基类。分享给大家供大家参考,具体如下: 配置文件: <?php $db = array( 'host'=>...