I am trying to allow the admin to create a new folder and upload multiple pictures files into a new user account. This user can then have access to this folder with assigned user/password. BUT when changing the code in the upload.php it will not upload the files and just refreshes. Below is the form and variables that passes the hidden value for the directory name for the files to be placed.
$id = $_GET['id'];
?>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Image upload</title>
<link href='http://fonts.googleapis.com/css?family=Boogaloo' rel='stylesheet' type='text/css'>
<link rel="StyleSheet" href="../../custom.css" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script type="text/javascript" src="js/multiupload.js"></script>
<script type="text/javascript">
var config = {
support : "image/jpg,image/png,image/bmp,image/jpeg,image/gif", // Valid file formats
form: "demoFiler", // Form ID
dragArea: "dragAndDropFiles", // Upload Area ID
uploadUrl: "upload.php" // Server side upload url
}
$(document).ready(function(){
initMultiUploader(config);
});
</script>
<link href="css/style.css" type="text/css" rel="stylesheet" />
</head>
<body lang="en">
<div id="content">
<?php require_once $header;
$sql_query = mysql_query("SELECT * FROM clients WHERE `id` = $id");
while($row = mysql_fetch_array($sql_query))
{
$fullname = $row['firstname'] . ' ' . $row['lastname'];
if (!file_exists('uploads/' . $fullname ))
{
mkdir('uploads/' . $fullname, 0777, true);
}
}
?>
<h1 class="title">Multiple Drag and Drop File Upload</h1>
<div id="dragAndDropFiles" class="uploadArea">
<h1>Drop Images Here</h1>
</div>
<form name="demoFiler" id="demoFiler" enctype="multipart/form-data">
<input type="file" name="multiUpload" id="multiUpload" multiple />
<input type="hidden" value="<?php echo $fullname; ?>" name="fullname" id="fullname"/>
<input type="submit" name="submitHandler" id="submitHandler" value="Upload" class="buttonUpload" />
</form>
<div class="progressBar">
<div class="status"></div></div>
</div>
</body>
</html>
And then the upload.php that the form is passed to, I have changed the value after upload/ in numerous ways to see if i can get files uploaded. I thought that this "uploads/"' . $_POST['fullname'] . '/'
would work but when the files upload they just keep refreshing and fail.
This is the upload.php
<?php
if($_SERVER['REQUEST_METHOD'] == "POST"){
if(move_uploaded_file($_FILES['file']['tmp_name'], "uploads/".$_FILES['file']['name'])){
echo($_POST['index']);
}
exit;
}
?>