PHP Form Upload Troubles.
Posted by: akmattb
Posted on: 2007-02-08 00:08:00
I am fairly new to php file uploads. but at this moment i am just trying to make a simple upload script that will throw a file into a directory. i don't care what the file is as long as its in the directory.
The form itself works fine. Just the upload doesn't happen.
here is my html form code:
<more form above>
<td colspan="3">
Please choose a file: <input name="uploadedfile" type="file" />
</td>
<more form below>
here is my php code that handles the upload:
<more php above>
if(isset($_POST['uploaded'])) {
// Where the file is going to be placed
$target_path = "uploads/";
/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
}
<more php below>
Any help would be greatly appreciated! Thanks!!!!
Matt