Welcome to WebDesignForums.net!
You're currently viewing WDF as a guest. By registering for a free account, you'll be able to participate with other members in our friendly community. Being a member allows you to ask questions and get answers for those troublesome web development tasks!

In addition, as a member you'll be able to post your websites up for review. Using our unique website review system you can gain some amazing feedback from some of the best web developers around. This is a completely free service to all registered members.

Ready to register yet? Registration is 100% free. Click Here To Join Now!

Use current PHP email script to attach multiple image files?

Discussion in 'PHP' started by dctalks, Aug 20, 2012.

  1. Offline

    dctalks New Member

    Message Count:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I have created this php file so that users can apply online. There is two areas thou where I need them to upload a picture. I listed those values as 'headshot' and 'bodyshot'. What else do I need add to this php so that the files will attach properly and send?

    I am new to learning this and would really like clear insight on what to add. Thank you for your time and help!

    Current code:

    PHP:
    <?php
      
    /* Email Variables */
    $emailSubject 'employment'/*Make sure this matches the name of your file*/
    $webMaster 'cleaningdonerightaz@gmail.com';
      
    /* Data Variables */
    $firstname $_POST['firstname'];
    $lastname $_POST['lastname'];
    $address $_POST['adress'];
    $city $_POST['city'];
    $zipcode $_POST['zipcode'];
    $phone $_POST['phone'];
    $email $_POST['email'];
    $howdidyouhear $_POST['howdidyouhear'];
    $age $_POST['age'];
    $uscitizen $_POST['uscitizen'];
    $driverlicense $_POST['driverlicense'];
    $transportation $_POST['transportation'];
    $adultservice $_POST['adultservice'];
    $bodycomfort $_POST['bodycomfort'];
    $headshot $_POST['headshot'];
    $bodyshot $_POST['bodyshot'];
    $startdate $_POST['startdate'];
    $hours $_POST['hours'];
    $weekdays $_POST['weekdays'];
    $aboutyou $_POST['aboutyou'];
    $whywork $_POST['whywork'];
    $questions $_POST['questions'];

    $body = <<<EOD
    <br><hr><br>
    First Name: 
    $firstname <br>
    Last Name: 
    $lastname <br>
    Address: 
    $address <br>
    City: 
    $city <br>
    Zip Code: 
    $zipcode <br>
    Phone: 
    $phone <br>
    Email: 
    $email <br>
    How did you hear about us: 
    $howdidyouhear <br>
    Age: 
    $age <br>
    Are you eligible to work in the US: 
    $uscitizen <br>
    Do you have a vaild Drivers License: 
    $driverlicense <br>
    Do you have reliable transportation: 
    $transportation <br>
    Have you worked in an adult/exotic service before: 
    $adultservice <br>
    On a scale how comfortable are you with your body: 
    $bodycomfort <br>
    Headshot: 
    $headshot <br>
    Bodyshot: 
    $bodyshot <br>
    When could you start: 
    $startdate <br>
    Total hours available per week: 
    $hours <br>
    What days are you available: 
    $weekdays <br>
    What you do now: 
    $aboutyou <br>
    Why you want to work for Cleaning Done Right: 
    $whywork <br>
    Questions for us: 
    $questions <br>
    EOD;
    $headers "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success mail($webMaster$emailSubject$body,
    $headers);

    /* Results rendered as HTML */
    $theResults = <<<EOD
    <html>
    <head>
    <title>sent message</title>
    <meta http-equiv="refresh" content="3;URL=http://cleaningdonerightaz.com">
    <style type="text/css">
    <!--
    body {
    background-color: #444; /* You can edit this CSS to match your website*/
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    color: #fec001;
    text-decoration: none;
    padding-top: 200px;
    margin-left: 150px;
    width: 800px;
    }
    -->
    </style>
    </head>
    <div align="center">Thank you. Your application has been successfully sent to Cleaning Done Right.</div>
    </div>
    </body>
    </html>
    EOD;
    echo 
    "$theResults";
    ?>
    This is just the first initial build of the site, we will use databases later on in the next 2 months, but for now I need help with the current code to produce the upload for the files.

    Can anyone please assist me with what I am asking for?

    Thank you again for your time in advance.


Share This Page