我已成功将我的文件传输到我的服务器,但我也在发送参数,如何在执行此操作后重定向到页面并预先填充这些参数?人们说它只是$ _POST,但我无法得到它。
function uploadPhoto(imageURI) {
var title1 = document.getElementById('title').value;
var desc1 = document.getElementById('desc').value;
var options = new FileUploadOptions();
options.key = "file";
options.fileName = imageURI.substr(imageURI.lastIndexOf('/')+1);
options.mimeType = "image/jpeg";
var params = {};
params.title = title1;
params.desc = desc1;
options.params = params;
options.chunkedMode = false;
var ft = new FileTransfer();
ft.upload(imageURI, "HTTP:HERP", win, fail, options);
window.location.href = "HTTP:DERP";
}
服务器代码
<?php
if(isset($_POST["title"]))
var_dump($_POST["title"]);
?>
答案 0 :(得分:0)
尝试:
echo $_REQUEST['title'];
echo $_REQUEST['desc'];
print var_dump($_REQUEST);