I’m having trouble figuring out how to run a php script after a jquery script runs. I have a form that is using uploadify to display a status bar and upload an attachment to the server. After that runs I want to run a php script to store all of the other form data. Here is a simplified version with just one post variable (title).
<form action="" method="post" >
<div id="queue"></div>
<input type="text" name="title" placeholder="Video Title..." />
<input id="file_upload" name="file_upload" type="file">
<button class="submit" type="button" value="Upload" onclick="javascript:$('#file_upload').uploadifive('upload')">Submit Form</button>
</form>
<script type="text/javascript">
$(function() {
$('#file_upload').uploadifive({
'auto' : false,
'formData' : {'test' : 'something'},
'queueID' : 'queue',
'uploadScript' : 'uploadifive.php',
'onUploadComplete' : function(file, data) {
console.log(data),
$('form').post('scripts/test_video_demo.php');
}
});
});
</script>