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 trialCortney Burgess
10,758 PointsThe code below contains a simple HTML form. It looks fine in the browser, but it does not send the information to the server. In this code challenge, we’ll make a few modifications so that it will. First, we need the data submitted to a process.php file i
<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>
<label for="flavor">Flavor</label>
<select id="flavor">
<option value="">— Select —</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>
3 Answers
Logan R
22,989 PointsYou need to change < form > to < form action="process.php" >
Hope this helped!
Cortney Burgess
10,758 Pointsyes this helped what do you do for this step 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.)
Logan R
22,989 PointsYou need to make the method of the form POST. This way the results are posted to the proceeding page and can be retrieved by PHP. You also need to add a name tag to the flavor drop down box. If you still can not figure it out, I will post my code so you can take a look and see what you need to do :)
Thanks!
Cortney Burgess
10,758 Pointsi do not understand..
blake McMullin
1,337 Pointsin addition to the above comment, you also need to add into the form section, method="post"