$.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); |
|