I asked a similar question on this forum and got pointed into a good direction but I've tried several, several, several tutorials and codes to no end. The code and tutorials i discovered were at first to simply upload one image into a folder. That worked no problem. Then I tried several where I should have been able to upload multiple images at once but that didn't work for me (but did for the presenter and lots of over people). Still, even if it worked I don't have the knowledge yet at php to make it to where it writes the name of the file into a database field for later use.
So, if I'm going to bother you guys for help I might as well ask for the whole thing at once.
So far all I have gotten is a form that uploads to a folder on the directory.
01_mypage.php:
- Code: Select all
<form action="01_upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<br />
<br />
<input type="submit" value="submit" />
</form>
01_upload.php:
- Code: Select all
<?php
$name = $_FILES['file']['name'];
//$size = $_FILES['file']['size'];
//$type = $_FILES['file']['tmp_name'];
$tmp_name = $_FILES['file']['tmp_name'];
if(isset($name)){
if(!empty($name)){
$location = 'upload/';
if(move_uploaded_file($tmp_name, $location.$name)){
echo $name;
}else{
echo 'There was an error.';
}
}else{
echo 'Please select a file';
}
}
?>
Like I said, this works but it only uploads one image (not multiple) and doesn't write the file name to a database.
Please help. This has literally been 20 hours of research and this is all I have.

