multivalue-forms.php : Form Data « Form « PHP

Home
PHP
1.Chart
2.Class
3.Components
4.Cookie Session
5.Data Structure
6.Data Type
7.Date
8.Design Patterns
9.Development
10.DNS
11.Email
12.File Directory
13.Form
14.Functions
15.Graphics Image
16.HTML
17.Language Basics
18.Login Authentication
19.Math
20.MySQL Database
21.Network
22.Operator
23.PDF
24.Reflection
25.Statement
26.String
27.Utility Function
28.Web Services SOAP WSDL
29.XML
PHP » Form » Form Data 




multivalue-forms.php
 
<?php
   if (isset($_POST['submit']))
   {
      echo "You like the following languages:<br />";
      foreach($_POST['languages'] AS $languageecho "$language<br />";
   }
?>

<form action="index.php" method="post">
   Check all that apply)
   <input type="checkbox" name="languages[]" value="csharp" />C#<br />
   <input type="checkbox" name="languages[]" value="jscript" />JavaScript<br />
   <input type="checkbox" name="languages[]" value="perl" />Perl<br />
   <input type="checkbox" name="languages[]" value="php" />PHP<br />
   <input type="submit" name="submit" value="Go!" />
</form>
  
  














Related examples in the same category
1.Deal with Array Form Data
2.A process_form() Function
3.Access widget's form value
4.Accessing multiple submitted values
5.Calculation based on form data
6.Forms and PHP
7.Feedback Form
8.Handling Special Characters
9.Saying "Hello"
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.