i've been folowing this tut http://www.youtube.com/watch?v=7iQWR76b ... ideo_title
i have managed to get this to work ok but now want to modify it a little, i now want to add in the abbility for a person to choose a directory to upload into and if it dosent already exsist it creates one.
Here is the current script i have tried and failed
<?php
if (isset($submit)) {
mkdir("bans"/$_POST['dir'], 0777);
}
if (isset($_FILES['files'])){
foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name){
move_uploaded_file($tmp_name, "bans/{$_FILES['files']['name'][$key]}");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Upload</title>
</head>
<body>
<div>
<form action="" method="post" enctype="multipart/form-data">
<p>
<label for="dir">Player Name:</label>
<input type="text" name="dir" id="dir" />
</p>
<p>
<input type="file" name="files[]" multiple="multiple" min="1" max="9999" />
<input type="submit" value="Upload" />
</p>
</form>
</div>
</body>
</html>
i know i havent added in the part for the img to be moved but its not creating the dir as it should do.sorry i am a noob at PHP this is the first real thing i've tried doing with it
Thanks in advanced
Damo
