Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

BUILD A BASIC WEBSITE

Challenge Task 3 of 4

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"]. Change the HTML so that the value for "flavor" is submitted to the process.php file. (Hint. An "id" attribute on a form input can be used by JavaScript and CSS but is not passed through the form submission.)

<form method = "post" action = "process.php"

<input type ="submit" value = "send"

<?php var_dump($_POST); ?>

2 Answers

Simon Coates
Simon Coates
28,692 Points

For starters, you should close the html elements.

<form method = "post" action = "process.php">
<input type ="text" name="flavor">
<input type ="submit" value = "send">
</form>
<?php var_dump($_POST); ?>

Thanks