I want to create a form in which i have some textfields and a field for a file upload.
In the action i upload the file first, and then save the values from the textfields in my database.
For a file upload I need enctype=”multipart/form-data” and then it works but the other things does not work.
when i take the default enctype the data save works but the file upload failed.
What should I do?
Any HTML source?
The enctype should also POST the textfields to the server. Make sure you access the file by
$_FILESand the other data by$_POST.You do need
enctype="multipart/form-data".If theres still something wrong, it’s not in your HTML.