I'm new at php, and I'm trying to create a sript that will allow you upload multiple files to a directory. I want to include a select box that will let you decide which directory you'd like to upload the images to. Can anyone help with this? Here's the code I have so far:
<?php
if ($imageFile !="none") {
for ($k =0; $k < count($imageFile); $k++) {
copy($imageFile[$k], "/home/heikou/public_html/test/$imageFile_name[$k]");
}
}
?>
<head>
<title>AvatarAdmin</title> </head>
<body>
<form action=<?php echo $PHP_SELF; ?> enctype="multipart/form-data" method="post">
<p>
<select name="age">
<option value="ah_megamisama">Ah! My Goddess</option>
<option value="anime_girls">Anime Girls</option>
<option value="cc_sakura">Card Captor Sakura</option>
<option value="chrono_cross">Chrono Cross</option>
</select>
</p>
<p>
<input type="file" size="40" name="imageFile[]"><br>
<input type="file" size="40" name="imageFile[]"><br>
<input type="file" size="40" name="imageFile[]"><br>
<input type="file" size="40" name="imageFile[]"><br>
<input type="file" size="40" name="imageFile[]"></p>
<input type="submit" name="submit" value="Add Images">
<input type="submit" value="Cancel" name="cancelit">
</form>
</body>