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.
The code below contains a simple HTML form. It looks fine in the browser, but it does not send the information to the se
Please help im stuck
<!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> <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> </body> </html>
MUZ140610 Tinashe Marunda
You need to put more into your FORM tag. You need to tell the browser where you want the information to be sent. Add an action parameter to the form and put the script you want the information to be sent to.
Where script.php is the script you want the information sent to. You should also put a method in as well. You put POST if you want to send a lot of information as well as protected information. You put GET if you want to send information through the URL and if you are sending a few unprotected pieces of information. By default, POST is used and really should be used. Just make sure that you use the $_POST array variable in order to access your information in the script handling your user input. Hope this helps.
<form action="script.php" method="POST">
Remember to use the
action attribute in a
form element to send data to another page. You set this attribute equal to the page you want to send data to. You should also set the
method attribute to the way you wish to send the data i.e. POST or GET.
You need to also pay attention to your other questions that you posted. If the answers helped you, you should at the very least comment back.