Welcome to the Treehouse Community
Looking to learn something new?
I make the method = post and i create a submit button; what special attribute should i put in the select tag?
i dont find anything which can access post data from server please help
<!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" <?php $a= $_POST; ?> > <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> <?php $_POST=value ?> </select> <input type="submit" value="Submit"> </form> </body> </html>
<?php $_POST=value ?>
will give you a syntax error - plus probably best not to overwrite the super global $_POST variable! I would remove this line.
remove the php from the select element:
<select id="flavor" <?php $a= $_POST; ?> >
You'll need to give the select element an attribute of name to pass it through the form submission and access it via $_POST['flavor']
<select id="flavor" name="flavor">