I was wondering if anyone would be able to help me out here. I have written a script using PHP to allow a user a project I am working on to upload a file into a MySQL database using PHP.
I would now like to improve on this script, ideally using jQuery as I have used in the past. I would like to be able to submit the upload and show a success overlay without forcing the user to leave the page.
I have Googled around and only succeeded in confusing myself, it would be great if anyone could help me out here.
My form that I need to submit the contents of is below.
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" id="fileUpload">
<label for="upload">Upload File</label>
<input type="file" name="upload" id="upload" />
<label for="desc">File Description</label>
<input type="text" name="desc" maxlength="225" id="desc" />
<label for="url">Site URL</label>
<label for="url" class="sameline">http:// </label><input type="text" name="url" maxlength="200" id="url" />
<input type="submit" id="submit" value="Upload" class="upload" />
Any help would be awesome!
If you don't want to reload the page, but want to submit data to a database, you're gonna need to look at the Ajax section of the jQuery site.