Ok, I have a file upload prob. I have a file upload that can upload (or is supposed to) 10 files at a time. But it doesnt work! I need someone to tell me whats wrong with it. Heres code:
[php]
case "upload";
?>
<form action="games_manage.php?id=<? echo "$id";?>&mode=uploadfiles" method="POST">
Upload multiple:<br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="file" name="userfile[]" class="input2"><br>
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
<input type="submit" value="Upload">
</form>
<?
break;
case "uploadfiles";
$file_count = 10;
for($i=0; $i<$file_count; $i++){
$userfile = $HTTP_POST_FILES[$i];
$userfile_name = $HTTP_POST_FILES[$i];
$userfile_type = $HTTP_POST_FILES[$i];
if($userfile_name != ""){
echo "No File(s) To upload<br>";
exit();
}
else {
$query = "SELECT * FROM games WHERE game_id='$id'";
$result = mysql_query($query);
$array = mysql_fetch_array($result); $game_name = $array[game_name];
$upfile = "../games/".$game_name."/images/".$userfile_name;
if(move_uploaded_file($userfile, $upfile)){
$chmod = chmod("$upfile", 0777);
echo "$userfile_name uploaded successfuly";
}
else {
echo "Could not upload $userfile_name<br>";
exit();
}
}
$i++;
}
break;
}
?>
[/php]
I get the error message saying could not upload...
Someone help!!
Can fat people Go skinny Dipping?