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

Here is my problem

Next, we need the flavor selected in the dropdown to be submitted to this process.php file. We need to be able to access it in the “flavor” element of the $_POST array like this: $_POST["flavor"]. What two changes do we need to make to the HTML? (Hint. We need to add two new attributes. The first needs to be added to one existing HTML element, the second needs to be added to a different existing HTML element.)

<!DOCTYPE html>
<html>
<head>
    <title>Ye Olde Ice Cream Shoppe</title>
</head>
<body>

    <p>Your order has been created. What flavor of ice cream would you like to add to it?</p>

    <form action="process.php" method="$_POST">

        <label for="flavor">Flavor</label>
        <select id="flavor">
            <option value="">&#8212; Select &#8212;</option>
            <option value="Vanilla">Vanilla</option>
            <option value="Chocolate">Chocolate</option>
            <option value="Strawberry">Strawberry</option>
            <option value="Cookie Dough">Cookie Dough</option>
        </select>

        <input type="submit" value="Update Order">

    </form>

</body>
</html>

Here is the question I can not figure out==== What do I need to add to the select element to solve this problem?

2 Answers

David Kaneshiro Jr.
David Kaneshiro Jr.
29,247 Points

I'll point out where the errors are. First the method attribute value in your form tag is not quite correct. You are close but there a little something extra that isn't needed. And the second thing is that you're missing an attribute in the select tag, but I can't quite figure out the name of the missing attribute.

the missing attribute is "name" , but I can't figure out what going in it...ex name=??????

David Kaneshiro Jr.
David Kaneshiro Jr.
29,247 Points

The value for name should be flavor.

It flat doesn't work now. I'm going insane. My email is ken.warren81@gmail.com . What should I put as the method on top and the submit to get through this? If you would email me I would be forever grateful! I will figure out the why's after I get the answer, but I've watched countless hours of video and need serious help!

I did fix the post deal....