need help with a form and PHP file upload

bizbez

Registered Member
Joined
Jan 26, 2011
Messages
86
Reaction score
3
hi all,

i have a simple POST form on my site which i need the users to upload files also. the form sends all the fields content to the DB.

my question is:

how should i write this in PHP - so users can upload a file and when they click submit - the location of the file, along with the other form fields are sent to the database, and the uploaded file is being uploaded.

please help,

thanks
 
W3 schools explains this pretty well:

Code:
http://www.w3schools.com/php/php_file_upload.asp

Pretty much what you will need to do is two files (same concept for ajax). One will contain the form and will probably just be on your normal site. The next will be a validation form that will process the fields/add them to the DB and save the file.
 
Back
Top