Results 1 to 2 of 2

Thread: Using $_FILES

  1. #1
    Join Date
    Mar 2006

    Question Using $_FILES

    I'm trying to allow the user to select a picture and attach it to the form which the sends the email.

    Eveything works execpt the attaching a picture part, and I'm sure it has to do with my $_FILES Command.

    picture is the name used for the input in my form.
    PHP Code:

    = ($_POST['do']);

    $do == "send")
    $recipient "abcd@xxx.com";
    $name = ($_POST['name']);
    $email = ($_POST['email']);
    $phone = ($_POST['phone']);
    $upload = ($_FILES['picture']);
    $message = ($_POST['message']);
    $body "Name: $name \r\n Email: $email \r\n Phone: $phone \r\n Description: $message \r\n $upload";
    $formsend mail("$recipient""-QUOTE-","$body""From: $email ($name)\r\nReply-to:$email");

        echo (
    "<p>Your quote was sent!</p>");
    Last edited by hubiejr; 05-09-2006 at 02:37 AM.

  2. #2
    Join Date
    Jan 2005
    Alicante (Spain)
    $_FILES['fieldname'] holds an array of details about a particular file (or files), not the file itself. Also even if it did contain the image file contents as a string you can't just include it inline in your email body.

    Check out the mime mail script on my site or do a search on sending mime mail. Also check out the sticky on uploading images.
    Last edited by bokeh; 05-09-2006 at 05:57 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center