Running a php script after a query function completes

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>

	<script type="text/javascript">
		$(function() {
				'auto'         : false,
				'formData'     : {'test' : 'something'},
				'queueID'      : 'queue',
				'uploadScript' : 'uploadifive.php',
				'onUploadComplete' : function(file, data) {


Assuming your onUploadComplete event fires correctly it should be pretty easy to fix this :slight_smile:

I think what you’re trying to do is POST the <form>, however $(“form”) returns a jQuery object of a DOM Node which does not have the .post() method.

If you’d like to post the data from the form you’d have to do it using $.post and manually add the data, e.g.:

$.post("receiver.php", { name: "John", email: "" }, function( data ) { /* do something with data */ });

// of course if you just want to send the form data, you could do something like:
$.post("receiver.php", $("#your-form").serialize(), function( data ) { /* do something with data */ });