An HTML Form Including a SELECT Element : Form Select « Form « PHP

An HTML Form Including a SELECT Element

<title>An HTML form including a SELECT element</title>
<form action="formSelectData.php" method="POST">
  <input type="text" name="user">
  <textarea name="address" rows="5" cols="40"></textarea>
  <select name="products[]" multiple>
  <input type="submit" value="OK">

<!-- formSelectData.php

<title>Reading input from the form</title>
print "Welcome <b>$user</b><p>\n\n";
print "Your address is:<p>\n\n<b>$address</b><p>\n\n";
print "Your product choices are:<p>\n\n";
print "<ul>\n\n";
foreach ( $products as $value ){
    print "<li>$value<br>\n";
print "</ul>";



Related examples in the same category

1.Form select input
3.A day choice
4.An HTML Form with a select Element
5.Validating a drop-down menu with in_array()
6.Displaying a
7.Generating a dynamic pull-down menu
8.Setting a default value in a
9.Setting defaults in a multi-valued
10.Creating Form Elements Based on the Current Time and/or Date
11.Creating Form Elements with Multiple Options
12.One choice for each day from 1 to 31
13.One choice for each year from last year to five years from now