Hi there, I have a website that i need to have a user submit some information and upload 2 files. And add the information to the database. what is the best way to do this. Any and all help would be apprechiated. This is a not for profit site. I need to collect the following information.

Name first and last
How long they have smoked
Have they ever tried to quit
ever use a E-cigerette
And allow them to upload Copy of license and medical note.
Needs to save to database.
I need to be able to check database for name and address to be sure that they havent submitted before
Be able to return them to page if there is a error or previously used name or address.
have script protect from injections, and invalid characters ect.
Send a notice that there submission was recieved to them.
Send a notice that there was a submission recieved to us.

the site is stopsmokinamerica.com
Any help you could provide would be awesome.

This is how I would do this. Create a form to add everything including the upload for the license and note. Choose what type of formats you want to allow also. (eg: pdf, png, jpg, rtf etc....)

Add the form fields to the database and upload the license and note to a protected folder on your server. Name the uploaded file first name_last name_state_some_random string or numbers and use this path in the database field.

You could also create a folder for that user on the fly with a random unique name and number and use that in your database for the file path.

This is just my opinion. I personally like directory structures for images and files instead of using a database. The less calls to a database the better.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.