深入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 function getFileSize($url){ $url = parse_url($url); if($fp = @fsockopen($u...

php 静态属性和静态方法区别详解

php 静态属性和静态方法区别详解

静态 public、private、protected 静态属性     在属性或方法前加static关键字,即为静态属性   ...

php设计模式 FlyWeight (享元模式)

享元模式英文称为“Flyweight Pattern”,我非常感谢将Flyweight Pattern翻译成享元模式的那位强人,因为这个词将这个模式使用的方式明白得表示了出来;如果翻译成...

详解WordPress开发中的get_post与get_posts函数使用

get_post() 在一般主题制作时,get_post()函数我们一般很少会用到,但因为后面会讲到get_posts(),所以我们不得不先讲一下这个单数形式。这个函数的主要作用是,将...

两款万能的php分页类

本文为大家分享个超级好用、万能的php分页类,具体的实现代码如下 第一款php分页类 <?php /* * To change this template, choo...