I want to upload and store multiple files/pics path in database with 1 submit button ...... This is what i am doing in html form
Icon:
<br>
<br>
<input type="file" name="uploadedfile" >
<br>
<br>
Screenshot:
<br>
<br>
<input type="file" name ="fileToUpload">
<br>
And this is my php code
<?php
if (isset($_POST['submit'])){
$target_dir= "images/";
$target_file= $target_dir.basename($_FILES['uploadedfile']['name']);
$tmp=$_FILES['uploadedfile']['tmp_name'];
if (move_uploaded_file($tmp,$target_file) ){
echo "uploaded successfully";
}
else {
echo "not uploaded successfully";
}
$targets_dir= "images/";
$targets_file= $targets_dir.basename($_FILES['fileToUpload']['name']);
$tmps=$_FILES['fileToUpload']['tmp_name'];
if (move_uploaded_file($tmps,$targets_file) ){
echo "uploaded successfully";
}
else {
echo "not uploaded successfully";
}
$insert=" insert into app values (DEFAULT,'$Title', '$target_file' , '$targets_file' )";
}
But its not working ...... Any advice will be appreciated .. Thanks in advance