-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckbox.php
43 lines (36 loc) · 1.02 KB
/
checkbox.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="index.php" method="post">
<input type="checkbox" name="pizza" value="Pizza">Pizza<br>
<input type="checkbox" name="hamburger" value="Hamburger">hamburger<br>
<input type="checkbox" name="hotdog" value="Hotdog">Hotdog<br>
<input type="checkbox" name="taco" value="Taco">Taco<br>
<input type="submit" name = "submit" value="confirm"><br>
</form>
</body>
</html>
<?php
if(isset($_POST["submit"])){
if(isset($_POST["pizza"])){
echo "You like pizza";
}
if(isset($_POST["hamburger"])){
echo "You like hamburger";
}
if(isset($_POST["hotdog"])){
echo "You like hotdog";
}
if(isset($_POST["taco"])){
echo "You like taco";
}
else{
echo"Please make a selection";
}
}
?>