You are here: copy function Q « PHP SQL « IT news, forums, messages
copy function Q

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация