Uploading a file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moishy
    New Member
    • Oct 2006
    • 104

    #1

    Uploading a file

    What do I need to do to make that a user can attach files.

    Let me Clarify;
    I want it to look like this:

    Name:
    Email:
    Attach a file | Browse |

    So what should the form HTML code be
    and what should the php script be?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    What have you developed until now for this form? Please show your code.
    If you haven't developed nothing yet, it might be a good idea to start and, when you run into problems, come back here. This forum is intended to make people help each other, it is not intended to produce code on order.

    See also the Posting Guidelines at the top of this forum, under the paragraph Homework.

    Ronald :cool:

    Comment

    • vssp
      Contributor
      • Jul 2006
      • 268

      #3
      [php]
      <?php
      /* recipients */
      $to = "mary@example.c om" . ", " ; // note the comma
      $to .= "kelly@example. com";

      /* subject */
      $subject = "Birthday Reminders for August";

      /* message */
      $message = '
      <html>
      <head>
      <title>Birthd ay Reminders for August</title>
      </head>
      <body>
      <p>Here are the birthdays upcoming in August!</p>
      <table>
      <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
      </tr>
      <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
      </tr>
      <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
      </tr>
      </table>
      </body>
      </html>
      ';

      /* To send HTML mail, you can set the Content-type header. */
      $headers = "MIME-Version: 1.0\r\n";
      $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

      /* additional headers */
      $headers .= "To: Mary <mary@example.c om>, Kelly <kelly@example. com>\r\n";
      $headers .= "From: Birthday Reminder <birthday@examp le.com>\r\n";
      $headers .= "Cc: birthdayarchive @example.com\r\n";
      $headers .= "Bcc: birthdaycheck@e xample.com\r\n";

      /* and now mail it */
      mail($to, $subject, $message, $headers);
      ?>[/php]
      use this sample code to send the message


      vssp

      vssp, you are experienced enough to know that you have to use code or php tags when displaying code.

      Ronald :cool:

      Comment

      Working...