Mega Code Archive

 
Categories / Php / Form
 

An HTML Form Including a SELECT Element

<html> <head> <title>An HTML form including a SELECT element</title> </head> <body> <form action="formSelectData.php" method="POST">   <input type="text" name="user">   <br>   <textarea name="address" rows="5" cols="40"></textarea>   <br>   <select name="products[]" multiple>     <option>option1     <option>option2     <option>option3     <option>option4   </select>   <br>   <input type="submit" value="OK"> </form> </body> </html> <!-- formSelectData.php <html> <head> <title>Reading input from the form</title> </head> <body> <?php 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>"; ?> </body> </html> -->