1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| while(list($key,$value) = each($_FILES[photo][name]))
{
if(!empty($value))
{ // this will check if any blank field is entered
$filename = $value; // filename stores the value
$filename=str_replace(" ","_",$filename);
$add = "biens/$filename"; // upload directory path is set
$data = "biens/$filename;";
echo $data;
copy($_FILES[photo][tmp_name][$key], $add); // upload the file to the server
chmod("$add",0777); // set permission to the file.
//echo"$add";
$datasend = explode(";",$data);
$img1 = $datasend[0];
$img2 = $datasend[1];
$img3 = $datasend[2];
$img4 = $datasend[3];
$img5 = $datasend[4];
}
}
$query2 = "INSERT INTO biens_images(
id,
ref_bien_img,
img1,
img2,
img3,
img4,
img5
)
VALUES(
'',
'$max_ref_biens',
'$img1',
'$img2',
'$img3',
'$img4',
'$img5'
)"; |
Partager