Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

simple form issue

I have got a form which uploads a file, then emails the info to an email address.

But when I change the form to multi part (to handle the upload)
<form action="thankyou.php" method="post" enctype="multipart/form-data">

the file form element info doesn't appear in the email. Other form fields do. The file uploads perfectly.

I just need the file name to appear in the email (" . $_POST['attachment'].")

Form
+++++++++++++++++++++++++++++
<form action="thankyou.php" method="post" enctype="multipart/form-data">
<input name="attachment" type="file" id="attachment">
</form>

Thankyou.php
+++++++++++++++++++++++++++++
The following file has been uploaded.
Name: " . $_POST['attachment']."
0
Cheryl Lander
Asked:
Cheryl Lander
1 Solution
 
cx323Commented:
you can access the name like this: $_FILES["attachment"]["name"]
0
 
Michael701Commented:
you probably want to look in the upload code to move the file from the temp upload area.

http://www.php.net/features.file-upload

Michael
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now