I am trying to upload mutliple files (sucessful)
then set a var to its path (i think ok)
then echo the its path on an array loop thing (PROBLEM!!)
Heres the display page
<?php
include("pfunctions.php");
add_vars();
while(list($key,$value) = each($_FILES[images][name]))
{
if(!empty($value))
{
$filename = $value;
$add = uploads/$filename";
copy($_FILES[images][tmp_name][$key], $add);
chmod("$add",0777);
$image[$key] = $add;
}
}
//add all to db
$i=1;
while ($i<=$max) {
echo "Image $i: $image[$i]";
$i++;
}
?>
These are its functions
function add_vars(){
$make = $_POST['make'];
$model = $_POST['model'];
$year = $_POST['year'];
$desc = $_POST['description'];
$price = $_POST['price'];
$max = $_POST['max'];
}
//upload images for that car
function add_images($max) {
$m = $max;
echo "<form method=post action=addimg.php enctype='multipart/form-data'>";
echo "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>";
for($i=1; $i<=$max; $i++){
echo "<tr><td>Image $i</td><td>
<input type=file name='images[]' class='bginput'></td></tr>";
}
echo "<tr><td colspan=2 align=center><input type=submit value='Add Image'></td></tr>";
echo "<input type=hidden name='make' value=\"$make\">";
echo "<input type=hidden name='model' value=\"$model\">";
echo "<input type=hidden name='year' value=\"$year\">";
echo "<input type=hidden name='desc' value=\"$desc\">";
echo "<input type=hidden name='price' value=\"$price\">";
echo "<input type=hidden name='max' value=\"$m\">";
echo "</form> </table>";
}
I get nothing output, i know the vars are setting because i have seen 1 file name output before.
TIA
RT