i use this script to upload an image and send data with Ajax.
<script type="text/javascript">
<?php $timestamp = time();?>
$(function() {
var formInput = $(":input,:hidden").serialize();
$('#file_upload').uploadifive({
'auto' : false,
'checkScript' : 'check-exists.php',
'formData' : {
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>',
formInput
},
'queueID' : 'queue',
'uploadScript' : 'uploadifive.php',
'onUploadComplete' : function(file, data) { console.log(data); }
});
$('#start_upload').on('click', function () {
$('#file_upload').uploadifive('upload');
});
});
</script>
The form:
<form id="upload_document">
<input id="file_upload" name="file_upload" type="file" multiple>
<input name="form_userid" id="form_userid" type="hidden" value="<?php echo $_SESSION['userId']; ?>" />
<input type="button" id="start_upload" name="uploadenFormSend" value="Bestand(en) uploaden" class="button-pink">
</form>
When i send the form, $_POST['formInput'] returns:
form_userid=13647
But i only need the value (13647). What can i do to make this happend?