<?php
if(isset($_POST['btnSave'])){
$j = 0; //Variable for indexing uploaded image
$file_name_all="";
$target_path = "uploads/"; //Declaring Path for uploaded images
//loop to get individual element from the array
for ($i = 0; $i < count($_FILES['file']['name']); $i++) {
$validextensions = array("jpeg", "jpg", "png"); //Extensions which are allowed
$ext = explode('.', basename($_FILES['file']['name'][$i]));//explode file name from dot(.)
$file_extension = end($ext); //store extensions in the variable
$basename=basename($_FILES['file']['name'][$i]);
//echo"hi its base name".$basename;
$target_path = $target_path .$basename;//set the target path with a new name of image
$j = $j + 1;//increment the number of uploaded images according to the files in array
if (($_FILES["file"]["size"][$i] < (1024*1024)) //Approx. 100kb files can be uploaded.
&& in_array($file_extension, $validextensions)) {
if (move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path)) {//if file moved to uploads folder
echo $j. ').<span id="noerror">Image uploaded successfully!.</span><br/><br/>';
/***********************************************/
$file_name_all.=$target_path."*";
$filepath = rtrim($file_name_all, '*');
//echo"<img src=".$filepath." >";
/*************************************************/
} else {//if file was not moved.
echo $j. ').<span id="error">please try again!.</span><br/><br/>';
}
} else {//if file size and file type was incorrect.
echo $j. ').<span id="error">***Invalid file Size or Type***</span><br/><br/>';
}
}
$qry="INSERT INTO `eb_re_about_us`(`er_abt_us_id`, `er_cli_id`, `er_cli_abt_info`, `er_cli_abt_img`) VALUES (NULL,'$b1','$b5','$filepath')";
$res = mysql_query($qry,$conn);
if($res)
echo "<br/><br/>Client contact Person Information Details Saved successfully";
//header("location: nextaddclient.php");
//exit();
else
echo "<br/><br/>Client contact Person Information Details not saved successfully";
}
?>
Here $file_name_all And $filepath get 1 uplode file name 2 time?