---------------------
Where exactly do I put the $HTTP_POST_FILES['Attachment1']['name']
Is 'name' just generic variable that I can rename to whatever and simply put
<?php echo $name; ?>
I appologize for the very simplistic questions, but any help you may give is greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@ TNTEverett - I spent some time searching as you alluded to some other threads that might have more info, but I was not able to find them. My question is similar to binarywasp.
I built a small form for uploading up to 5 files. On the auto-generated thank you page, the files are listed by label.
File 1: Array
File 2: Array
etc.
I am not sure how to show the file name (the image is even nicer, but not really needed). I am also a PHP noob, but learning.
Thanks for reviewing this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I stumbled upon PHPform and it is EXACLT what I need, except for one thing:
On the process.php page when it displays the submitted results, under the image it shows: Array.
How can I edit the process.php file to actually display the image just uploaded?
I'm sure there is more than on epost here with the information you need but here it is again.
$HTTP_POST_FILES['Attachment1']['name']
Use this process.php variable where you want to display the name of the uploaded file.
"Attachment1" is the form field name from your form.
You'll have to pardon my noobidity on this, but I'm fairly new to all this.
My code is as follows:
<table width=50%>
<tr><td>Name: </td><td> <?php echo $Name; ?> </td></tr>
<tr><td>Email: </td><td> <?php echo $Email; ?> </td></tr>
<tr><td>File: </td><td> <?php echo $File; ?> </td></tr>
</table>
<!-- here is where I want the image to post-->
---------------------
Where exactly do I put the $HTTP_POST_FILES['Attachment1']['name']
Is 'name' just generic variable that I can rename to whatever and simply put
<?php echo $name; ?>
I appologize for the very simplistic questions, but any help you may give is greatly appreciated.
If $File is the field name from the form then somewhere near the top of your process.php insert the following:
$name=$HTTP_POST_FILES['File']['name'];
Then you can use
<?php echo $name; ?>
in your display.
Without seeing both the form.html and the process.php file I can not give you exact instructions.
@ TNTEverett - I spent some time searching as you alluded to some other threads that might have more info, but I was not able to find them. My question is similar to binarywasp.
I built a small form for uploading up to 5 files. On the auto-generated thank you page, the files are listed by label.
File 1: Array
File 2: Array
etc.
I am not sure how to show the file name (the image is even nicer, but not really needed). I am also a PHP noob, but learning.
Thanks for reviewing this.
Find the part of the process.php file that displays your file names. It will look somthing like this:
File 1: " . $_POST['field_3'] . "
Change it to something like this:
File 1: " . $_FILES['field_3']['name'] . "
I just built a new form still all file fields of the file upload don't show a name. They all say "array".