This code works for me. There is some more good advice here:
http://www.tizag.com/phpT/fileupload.php
<?php
if ($_POST["upload"])
{
$path = "files/" . $_POST["dst"] . "/";
mkdir($path, 0777, true);
foreach ($_FILES["file"]["tmp_name"] as $key => $src)
{
move_uploaded_file($src, $path . basename($_FILES["file"]["name"][$key]));
}
}
?>
<form method=post enctype=multipart/form-data>
Destination: <input type=text name=dst><br>
File 1: <input type=file name=file[]><br>
File 2: <input type=file name=file[]><br>
File 3: <input type=file name=file[]><br>
File 4: <input type=file name=file[]><br>
<input type=submit name=upload value=Upload>
</form>
As far as error messages, its just a programming method of confirming code is running as expected. Some people call it "logging messages" or "verbose-ing".
Its easy to have a log function that you disable when you go live.
The above is lacking error checking, but I tried to make it as simple as possible. Note, mkdir() will fail if the directory exists, so, use file_exists() as well.
I would log messages to the user of successfully uploaded file. Maybe give them a list of files already uploaded to their account names.
Hope that helps you.