我想用uploadData發送表單的附加數據使用scriptData,但它不會發送任何內容到後端PHP腳本。有人可以幫我嗎?下面是我想..用Uploadify發送表單數據的問題
的Javascript:
<script type="text/javascript">
$(document).ready(function() {
$("#fileUpload").fileUpload({
'uploader': 'uploadify/uploader.swf',
'cancelImg': 'uploadify/cancel.png',
'script': 'uploadify/upload.php',
'folder': 'files',
'multi': false,
'displayData': 'speed',
'scriptData' : {'name' : $('#name').val()},
onComplete: function (evt, queueID, fileObj, response, data) {
alert("Successfully uploaded: "+response);
}
});
});
</script>
HTML:
Name: <input name="name" id="name" /><br />
<div id="fileUpload">You have a problem with your javascript</div>
<a href="javascript:$('#fileUpload').fileUploadStart()">Start Upload</a> | <a href="javascript:$('#fileUpload').fileUploadClearQueue()">Clear Queue</a>
upload.php的
(我曾經嘗試都POST和GET方法,沒有作品)。
$name = $_GET['name'];
or
$name = $_POST['name'];
我會非常感謝您的幫助。