/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] form email output

If I’m using a simple form to directly deliver mail to a desired email address without an email client like so:

[code=php]Thanks, <?php
@extract($_POST);
$sub=”Form feedback”;
$firstname = stripslashes($firstname);
$lastname = stripslashes($lastname);
$email = stripslashes($email);
$phone = stripslashes($phone);
$Facials = stripslashes($Facials);
$Makeovers = stripslashes($Makeovers);
mail(‘[email protected]’,$sub,”$firstnamen$lastnamen$emailn$phonen$Facialsn$Makeovers”,”From: $name <[email protected]>”);
echo stripslashes($name);

?> , we will drop you a line shortly.[/code]

The first 4 fields deliver fine, they are all text input boxes, but the Facials and Makeovers are part of a drop down select option like so:

[code=html]<tr bgcolor=”#ede5cb”>
<td width=”50%”>First service:</td>
<td align=”right”>
<select name=”AService1″ class=”form” style=”width:300px”>
<option value=””>Choose 1st Service</option>
<option value=”Facials” name=”Facials”>Facials – Signature Facial Treatments</option><option value=”Makeovers”>Makeovers – Makeup Application</option><option value=”104657″>Massage &amp; Bodywork – Massage Treatments</option><option value=”90930″>Skin Care – Chemical &amp; Exfoliation Treatments</option><option value=”159061″>Skin Care – Skin Care Treatments</option><option value=”90922″>Special Occasion Services – Services for the Bride</option><option value=”90923″>Special Occasion Services – Services for the Groom</option><option value=”90924″>Special Occasion Services – Bridal Party Services</option><option value=”90925″>Special Occasion Services – Grooms Party Services</option><option value=”104459″>Sunless Tanning – SunFX</option>
</select>
</td>
</tr>[/code]

I thought to change the option value to “Facials” or add the name field and than assign it “Facials” but neither seem to work…

Help please, thanks in advance fellas!

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SupplementauthorNov 20.2011 — anyone?
Copy linkTweet thisAlerts:
@SupplementauthorNov 21.2011 — nevermind, I'm a spaz, it's the same way as a text input field..
Copy linkTweet thisAlerts:
@sonicpaintNov 23.2011 — Unfortnately, you haven't posted the entire form so we can't see if you've added the following at the beginning and end of the table with the form fields.

So we'll start with the HTML.

  • 1. Make sure you've created a form for submission.


  • [code=html]<form action="location_to_Post" method="post" name="form_name">
    <!-- form fields go here -->
    </form>[/code]


  • 2. Add your selection box in the form.

    [code=html]<select name="AService1">
    <option value=""></option>
    </select>[/code]


  • NOTE: there should not be any names in the dropdown options

  • 3. On to the PHP...


  • [code=php]<?php

    if(isset($_POST["form_name"])){

    //declare your variables here - two examples
    $var1 = ($var1);
    $var2 = ($var2);
    // NOTE: Make sure the form values are being called

    // to send mail use the following
    $to="[email protected]";
    $email="[email protected]";
    $subject="Subject line";
    $message="Message content and variables goes here";
    $headers='From:'.$email . "rn" .'Reply-To:'. $email ."rn";
    mail($to,$subject,$message,$headers);
    //NOTE: if you are going to send HTML, you'll need additional headers
    }

    ?>[/code]
    Copy linkTweet thisAlerts:
    @SupplementauthorNov 23.2011 — thanks, i figured it out!
    ×

    Success!

    Help @Supplement spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...