forked from milq/milq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
31 lines (27 loc) · 757 Bytes
/
process.php
File metadata and controls
31 lines (27 loc) · 757 Bytes
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
<html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
<head>
<meta charset='utf-8' />
<title>Basic form in PHP</title>
</head>
<body>
<h1>Basic form - Processing data</h1>
<?php
$name = $_POST['name'];
$age = $_POST['age'];
$gender = $_POST['gender'];
$hobbies_array = [];
if (isset($_POST['hobbies'])) {
$hobbies_array = $_POST['hobbies'];
}
?>
<p>Your name is <?php echo $name; ?>.</p>
<p>You are <?php echo $age; ?> years old.</p>
<p>Your gender is <?php echo $gender; ?>.</p>
<p>Your hobbies are:</p>
<ul>
<?php for($i = 0; $i < count($hobbies_array); $i++) { ?>
<li><?php echo $hobbies_array[$i]; ?></li>
<?php } ?>
</ul>
</body>
</html>