simple form issue

Posted on 2007-07-26
Last Modified: 2013-12-13
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 action="thankyou.php" method="post" enctype="multipart/form-data">
<input name="attachment" type="file" id="attachment">

The following file has been uploaded.
Name: " . $_POST['attachment']."
Question by:Cheryl Lander
    LVL 4

    Accepted Solution

    you can access the name like this: $_FILES["attachment"]["name"]
    LVL 19

    Expert Comment

    you probably want to look in the upload code to move the file from the temp upload area.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now