Ok So. This has been driving me crazy. I want a form to 'add a product' which places data X Y Z into database which works fine and post to self without issues.(As I removed the image part).
I now want to upload a file, I presume use
<form action="thissameurl.php" method="post" enctype="multipart/form-data">
<input type="file" name="productimage">
</form>
To add to my form (just the input bit would be added).
Now, what do I need to add to my 'if post' section in the header to allow me to..
1.) Upload the file to a permanent folder
2.) Keep the original file name
3.) Have the filename (not the path) in a variable so that I can store it in the database.
Now im a sure this isn't as difficult as it seems to be. I am open to other technologies if they make it easier than using PHP. The files aren't going to be very large and have check that PHP.ini allows for them to be good enough.
I have looked at http://www.w3schools.com/php/php_file_upload.asp without much success.
Many thanks in advance.
foreachis for multiple uploads at once or for an array of allowed files, depending on what "your"foreachis.