【发布时间】:2017-06-09 10:29:54
【问题描述】:
当我从 users.php 中删除“if(isset($_POST['_upload_profile_image'])){}”。代码正在工作和上传。
如何使用 'isset($_POST'.
我的查询
$("#upload_profile_image").on('submit',(function(e) {
e.preventDefault();
$.ajax({
url: "/particley/global/post/users.php",
type: "POST",
data: new FormData(this),
contentType: false,
cache: false,
processData:false,
success: function (html) {
if (html == 'true') {
//
} else {
//
}
}
});
}));
我的PHP
if(isset($_POST['_upload_profile_image'])){
$upload = ($_FILES['image']['tmp_name']);
if ($users->upload($upload) === TRUE) {
echo 'true';
} else {
echo 'false';
}
}
【问题讨论】:
-
你试过 var dump $POST 吗?