白减黑
白减黑
  • 发布:2016-04-04 23:12
  • 更新:2016-04-04 23:12
  • 阅读:1225

用mui AJAX 传数据到 PHP 中为什么PHP 收不到数据? 或者怎么测试PHP 收到数据没有?

分类:MUI

我的前端代码是这个

mui.ajax('http://192.168.0.107:88/dbserver/reg.php', {
data: {
username: use_rname.value,
usernicheng:u_nicheng.value,
password: user_password.value,
email:user_email.value
},
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 5000, //超时时间设置为5秒;
success: function(data) {
//服务器返回响应,根据响应结果,分析是否登录成功;

                    },  
                    error: function() {  
                    plus.nativeUI.toast('ajax 出错');  

                    console.log(type);  

                    return;  
                    }  

                    });  

PHP 是这样取数据的

  @$username=$_POST['username'];  
  @$usernicheng=$_POST['usernicheng'];  
  @$password=$_POST['password'];  
  @$email=$_POST['email'];  

  echo '<pre>';  
  print_r($username);  

求指导~

发送过去以后PHP

2016-04-04 23:12 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复