Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Interactive Form - Output

I have a form with multiple answers per question and on certain questions(radio buttons), depending on which you chose, a different question(div) shows up next. I got the jquery working but when it comes time to submit the form I am not getting the selected answers to show up in the submitted email.

Here is an example of my html

```<div id="formModal" class="reveal-modal" data-reveal>

    <form accept-charset="UTF-8" action="survey.php" class="" id="new_signup_context" method="post" data-abide>

            <div class='choose_level tile'> 

                <div class='row'>

                    <div class='large-12 columns'>

                        <h2>What are you looking for?</h2>

                    </div>

                </div>

                <div class='row'>

                    <div class='large-6 columns opt1a'>

                        <label class='select' data-level='custom' for='level_custom'>

                        <img data-level='custom' src='img/51.png'>

                        </label>

                        <h3>Custom</h3>

                        <input id='level_custom' name='level1' type='radio' value='custom'>

                        <label class='button blue_button select' data-level='custom' for='level_custom'></label>

                    </div>

                    <div class='large-6 columns opt1b'>

                        <label class='select' data-level='townhome' for='level_townhome'>

                        <img data-level='townhome' src='img/aspen.png'>

                        </label>

                        <h3>Townhome</h3>

                        <input id='level_townhome' name='level1' type='radio' value='townhome'>

                        <label class='button blue_button select' data-level='townhome' for='level_townhome'></label>

                    </div>

                </div>

            </div>

        <!-- Custom Tier 1 -->

        <div class='choose_style tile centered hidden' data-behavior='SignUpDesigns'>

            <div class='row'>

                <div class='large-12 columns'>

                    <h2>Pick the style(s) of home you like.</h2>

                    <div class='store_errors errors'></div>

                </div>

            </div>

            <div class='row homes'>

                <div class='hometype large-3 columns'>

                    <div class='checked'></div>

                    <label for='prairie'>

                        <img src='img/prairie.png'>

                    </label>

                    <input id='prairie' name='hometypes' type='checkbox' value='Prairie'>                   

                </div>

                <div class='hometype large-3 columns'>

                    <div class='checked'></div>

                    <label for='traditional'>

                        <img src='img/traditional.png'>

                    </label>

                    <input id='traditional' name='hometypes' type='checkbox' value='Traditional'>

                </div>

                <div class='hometype large-3 columns'>

                    <div class='checked'></div>

                    <label for='transitional'>

                    <img src='img/transitional.png'>

                    </label>

                    <input id='transitional' name='hometypes' type='checkbox' value='Transitional'>

                </div>

                <div class='hometype large-3 columns'>

                    <div class='checked'></div>

                    <label for='bungalow'>

                        <img src='img/bungalow.png'>

                    </label>

                    <input id='bungalow' name='hometypes' type='checkbox' value="Bungalow">

                </div>

            </div>

            <div class='fixed_button homes hidden centered'>

                <button type="button" class="btn btn-inverse homes">Continue &rarr;</button>

            </div>

        </div>

        <!-- Endof Custom Tier 1 -->```

And here is what I tried for the PHP, which sends the email, but no info.

        $surveyName = trim($_POST["surveyName"]);
        $surveyEmail = trim($_POST["surveyEmail"]);
        $surveyMessage = trim($_POST["surveyMessage"]);


        $formcontent=" From: $surveyName \n Email: $surveyEmail  \n Message: $surveyMessage";

        foreach($_POST['var'] as $key=>$value) { echo $value; }

        $recipient = "x@xxxxxxxxxxxxxx.net";
        $subject = "New Inquiry Form";
        $mailheader = "From: $surveyEmail \r\n";
        $success=mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

           if(isset($_POST['surveySubmit'])) {
            header('Location: http://xxxxxxxx');
        }
            exit;

?>```