6-1. form. button HTML HTML & XHTML Chuck Musciano Bill Kennedy. submit. Enter 6-1

form PHP HTML text box button checkbox HTML Chuck Musciano HTML & XHTML Bill Kennedy submit Enter 6-1 6-1 if (array_key_exists('my_name',$_POS...
Author: Sophia Cooper
2 downloads 2 Views 831KB Size
form

PHP

HTML text box

button

checkbox

HTML Chuck Musciano

HTML & XHTML Bill Kennedy submit

Enter 6-1

6-1 if (array_key_exists('my_name',$_POST)) { print "Hello, ". $_POST['my_name']; } else { print

6-5

Chicken Bun

Bird-Nest Bun

Selected buns: You want a chicken bun. You want a nest bun.

PHP

lunch[] chicken

nest

$_POST['lunch'][] = 'chicken'; $_POST['lunch'][] = 'nest';

4-5

6-1 6-6

6-1

6-6 // if (array_key_exists('my_name',$_POST)) { process_form(); } else { show_form(); } // function process_form() {

98

6-6 print "Hello, ". $_POST['my_name']; } // function show_form() { print => => =>

'yes', 'medium', array('taro','tripe'), 'cake');

$_POST['_submit_check'] $_POST['_submit_check'] main_dish

111

HTML

$defaults htmlentities() HTML (textarea)

value

$defaults

6-24

6-24 print '';





6-25

6-25 print ''; print htmlentities($defaults['comments']); print '';

selected="selected"

6-26

6-26 $sweets = array('puff' => 'Sesame Seed Puff', 'square' => 'Coconut Milk Gelatin Square', 'cake' => 'Brown Sugar Cake', 'ricemeat' => 'Sweet Rice and Meat'); print ''; // $val , $choice foreach ($sweets as $option => $label) { print '