Posted by Techris on 10/14/35 11:53
Can anyone tell me why this isn't working.. I am sure its just something
stupid but I can't see it yet.
<?PHP
function uploadpic($pic){
foreach($pic as $value){
copy ($_FILES['$value']['tmp_name'], $_FILES['$value']['name'])
or die ("Could not copy");
echo "<img width=\"100\" src=
\"".$_FILES['$value']['name']."\"<br><br><br>";
echo "Name: ".$_FILES['$value']['name']."<br>";
echo "Size: ".$_FILES['$value']['size']."<br>";
echo "Type: ".$_FILES['$value']['type']."<br>";
echo "Upload Done....<br>";
}
}
if(!empty($pic) && $mode == "uploadpic")
{
uploadpic($pic);
}
else {
echo "<form name=\"form1\" method=\"post\"
action=\"index.php?mode=$mode&pic=$pic\"><br>";
echo "First Picture:<input type=\"file\" name=\"$pic[0]\"><br>";
echo "Second Picture:<input type=\"file\" name=\"$pic[1]\"><br>";
echo "Third Picture:<input type=\"file\" name=\"$pic[2]\"><br>";
echo "Fourth Picture:<input type=\"file\" name=\"$pic[3]\"><br>";
echo "Fifth Picture:<input type=\"file\" name=\"$pic[4]\"><br>";
echo "<input type=\"hidden\" name=\"mode\" value=\"uploadpic\">";
echo" <br>
<br><br>
<input type=\"submit\" name=\"submit\" value=\"Submit\">
";
echo "</form>";
}
?>
Navigation:
[Reply to this message]
|