当前位置: 移动技术网 > IT编程>开发语言>PHP > 深入extjs与php参数交互的详解

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

2019年04月08日  | 移动技术网IT编程  | 我要评论

蔡优美,雏妃,快递打印

复制代码 代码如下:

<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);
?>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网