Due-diligence done, once again I return to the experts. Please forgive my ignorance, new to all this.
I'm trying to create a form which allows users to:
- Insert the values of various form fields into a mysql database table - Easy, no issues here.
- Attach a file which is saved within the file structure (in a folder called 'documents').
- Save the file name, size, type (pdf, txt, etc.) to the same record.
After a file is uploaded the table would contain:
- id (auto incremented)
- name (text field, user generated)
- description (text field, user generated)
- File name (e.g. text.txt, added automatically on upload)
- File size (e.g. 362455[kb], added automatically on upload)
- File type (e.g. pdf, added automatically on upload)
I've successfully saved files to the folder but have not been able to make my three requirements a reality... Despite hours or troubleshoot and Googling.
The database and form are correct, the php file I post to is the mystery. Any ideas?
<form method="post" id="addForm" action="includes/insert_news.php">
<table class="addForm" cellspacing="0">
<tr>
<th>Name:<span class="greenText">*</span></th>
<td><input name="name" type="text" class="textBox required" value="Friendly Document Name" maxlength="80" /></td>
</tr>
<tr>
<th>Description:<span class="greenText">*</span></th>
<td><textarea name="description" class="textBox required">Document description blah blah</textarea></td>
</tr>
<tr>
<th>File:</th>
<td><input name="file" class="textBox" /></td>
</tr>
<tr>
<th> </th>
<td><input type="image" class="button" src="images/button_submit.gif" /></td>
</tr>
</table>