if the user added his email address, save in a database, call it email table
save a random key with the email, and a registration date, to be able to send a vaerification link to the email. If the user clicks on the link, then ask a password. If a user wanted to upload 5 images with a reserved email address which has verified, ask that password. You need to handle the several cases:
email hasn't been verified, delete it from the database.
If a user don't know the password, access should denied, and the uploaded images will deleted.
On upload, you register the email address into the email table, and have the email_ID(the primary key)
Create a folder with the email_ID, where you upload the images. If 2 user wanted to upload frog.jpg, the names won't overwrite each other.
How you should store the images and its file names in database?
User uploaded 5 files. You can use the $_FILES array to know the file types. If these are the acceptable, you save the base-names into the images table, then evry names will have a unique primary ID. You save the email_ID into the images table as foreign key. Lets move the uploaded files from the temporary folder into its destination place renamed based on the primary keys from last inserts.
upload folder/{$email_ID}/$last_insert
==>>> for cycle to list the uploaded files, checking the types will fill error message if any. The examples are good on php.net about move_uploaded_files()
Hello, jjozsi.