Uploading multiple files with FOR
Posted: Tue Mar 28, 2006 5:03 pm
I'm trying to upload a single file to different folders by using a for loop, but I only manage to introduce one.
Why?
Any hints ?
Why?
Any hints ?
Code: Select all
$newarray = array_values($values);
$total=count($newarray);
$todaydate= date("Y-d-m");
for($i=0; $i<$total; $i++){
$values2=$newarray[$i];
$uploadDir = "../requested/".$values2."/";
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
$sql=mysql_query("UPDATE Units SET internaldate='$todaydate' WHERE ip='$values2'", $connect) or die(mysql_error().'<p>'.$sql.'</p>');
}}