php 接收mui的上传文件,PHP 怎样处理mui.ajax POST过来的数据?

处理登录

*/

var doLogin=function(){

plus.nativeUI.showWaiting("登陆中...");

if(document.getElementById("tel").value && document.getElementById("pass").value){

var tel=document.getElementById("tel").value;

var pass=hex_md5(document.getElementById("pass").value);

}else{

plus.nativeUI.closeWaiting();

mui.toast('数据存在空值,不允许提交!');

return false;

}

mui.ajax(serverHost+'/interface/login',{

data:{

'tel':tel,

'pass':pass

},

dataType:'json',//服务器返回json格式数据

type:'post',//HTTP请求类型

timeout:5000,//超时时间设置为5秒;

success:function(d){

//服务器返回响应;

console.log(tel);

if(d.status==1){

setTimeout(function(){loginSuccess(d.uid,d.ukey);plus.nativeUI.closeWaiting();},480);

}else{

//mui.toast('登陆失败!');

console.log(d.message);

mui.toast(d.message);

plus.nativeUI.closeWaiting();

}

},

error:function(xhr,type,errorThrown){

//异常处理;

//console.log(errorThrown);

plus.nativeUI.closeWaiting();

plus.nativeUI.toast('网络数据链接失败!');

}

});

}

-------------php-----------------------

if(empty($data)){ajaxMsg('手机号未知或未绑定!',0);}

//密码是用密文传输的

if($data['user_pass']==trim(htmlspecialchars($_POST['pass']))){

$user=array(

'uid'=>intval($data['id']),

'ukey'=>$data['user_pass'],

);

ajaxMsg($user);

}else{

//echo time();

ajaxMsg('登录失败!',0);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值