表单.php
<form name="frm1" action="3.php" method="POST" enctype="multipart/form-data">
<div class="upload">
<input type="hidden" name="r" value="father" id="r">
<input type="hidden" name="id" value="<?=$id?>" id="r1">
<input type="hidden" name="page" value="<?=$a?>" id="r2">
<input type="file" name="uploadPic" id="upload" />
</div>
</form>
pop.js
$(".upload").on("click", function () {
console.log("page");
$(".upload").on("change", function () {
var fr =$("#r").val();
var fr1 =$("#r1").val();
var fr2 =$("#r2").val();
var fr3 =$("#upload").val();
//console.log("page"+fr+fr1+fr2+fr3);
$.post("upload.php", {
"pic": fr3}, function (data) {
console.log(eval(data));
if (data.result == "1") {
console.log("getresult");
//webpopup();
} else {
alert("Please try again.");
}
}, "json");
});
});
我想使用 $.POST 将整个图像作为输入文件发送。但我只能发送图像的名称。整体形象如何。