Copy link to clipboard
Copied
Hi,
I am using PHP
I have an upload form on my site. I want to be able to record the file names of the files uploaded in a database by copying the text/info in the file field to a text field or a hidden field in the form. That way when a file is uploaded if the file goes to the folder and a copy of the name of the file with extension goes into the database. I already know how to perform both tasks with one form. I just need to know how to automatically copy text from the file field to the text/hidden field.
Example:
File Field: bob.jpg
Text Field: bob.jpg
(copies info from file field when their is a value)
Thanks!
Copy link to clipboard
Copied
I'm not quite following. Why do you need to copy the filename to a hidden field. Isn't filename of the uploaded file already available to the php script?
Copy link to clipboard
Copied
Because for some reason when I just try uploading the text from the file field to the database it wont work, probably because its not a text field. So I need to copy from one to another.