-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathForm.php
More file actions
68 lines (55 loc) · 1.18 KB
/
Form.php
File metadata and controls
68 lines (55 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>
<head>
<title>Checkbox Demo</title>
</head>
<body>
<h1>Checkbox Demo</h1>
<h3>Demonstrates checkboxes</h3>
<form action ="HandleFormCheckBox.php">
<ul>
<li><input type ="checkbox" name ="chkFries" value ="11.00">Fries</li>
<li><input type ="checkbox" name ="chkSoda" value ="12.85">Soda</li>
<li><input type ="checkbox" name ="chkShake" value ="1.30">Shake</li>
<li><input type ="checkbox" name ="chkKetchup" value =".05">Ketchup</li>
</ul>
<input type ="submit">
</form>
</body>
</html>
<!-- HandleFormCheckBox.php
<html>
<head>
<title>Checkbox Demo</title>
</head>
<body>
<h3>Demonstrates reading checkboxes</h3>
<?
print <<<HERE
chkFries: $chkFries <br>
chkSoda: $chkSoda <br>
chkShake: $chkShake <br>
chkKetchup: $chkKetchup <br>
<hr>
HERE;
$total = 0;
if (!empty($chkFries)){
print ("You chose Fries <br>");
$total = $total + $chkFries;
}
if (!empty($chkSoda)){
print ("You chose Soda <br>");
$total = $total + $chkSoda;
}
if (!empty($chkShake)){
print ("You chose Shake <br>");
$total = $total + $chkShake;
}
if (!empty($chkKetchup)){
print ("You chose Ketchup <br>");
$total = $total + $chkKetchup;
}
print "The total cost is \$$total";
?>
</body>
</html>
-->