黑马程序员技术交流社区
标题:
ajax请求
[打印本页]
作者:
晴阳暴打远灯狗
时间:
2019-6-6 08:50
标题:
ajax请求
$.ajax({
type:'post',
url: "api/_upload.php",
data: data,
contentType:false,
processData:false,
success: function (res) {
console.log(res);
if(res.code==1){
newfile = '/static/uploads/'+res.file;
$('.thumbnail').show().attr('src',newfile);
}
}
});
$email = $_POST['email'];
$password= $_POST['password'];
$sql = "SELECT * From users u where u.email = '{$email}' and u.`password`='{$password}' and u.`status`= 'activated'";
$result = getData($sql);
// print_r($result);
$response = ["code"=>0,"msg"=>"操作失败"];
if($result){
$response["code"] = 1;
$response["msg"] = "操作成功";
}
header('content-type:application/json;charset=utf-8');
echo json_encode($response);
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2