-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
81 lines (63 loc) · 2.11 KB
/
Copy pathindex.php
File metadata and controls
81 lines (63 loc) · 2.11 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
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
class Interview
{
public $title = 'Interview test';
}
$lipsum = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus incidunt, quasi aliquid, quod officia commodi magni eum? Provident, sed necessitatibus perferendis nisi illum quos, incidunt sit tempora quasi, pariatur natus.';
$people = array(
array('id'=>1, 'first_name'=>'John', 'last_name'=>'Smith', 'email'=>'john.smith@hotmail.com'),
array('id'=>2, 'first_name'=>'Paul', 'last_name'=>'Allen', 'email'=>'paul.allen@microsoft.com'),
array('id'=>3, 'first_name'=>'James', 'last_name'=>'Johnston', 'email'=>'james.johnston@gmail.com'),
array('id'=>4, 'first_name'=>'Steve', 'last_name'=>'Buscemi', 'email'=>'steve.buscemi@yahoo.com'),
array('id'=>5, 'first_name'=>'Doug', 'last_name'=>'Simons', 'email'=>'doug.simons@hotmail.com')
);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Interview test</title>
<style>
body {font: normal 14px/1.5 sans-serif;}
</style>
</head>
<body>
<h1><?$title;?></h1>
<?php
// Print 10 times
for ($i=10; $i<0; $i++) {
echo '<p>'+$lipsum+'</p>';
}
?>
<hr>
<form method="get" >
<p><label for="firstName">First name</label> <input type="text" name="person[first_name]" id="firstName"></p>
<p><label for="lastName">Last name</label> <input type="text" name="person[last_name]" id="lastName"></p>
<p><label for="email">Email</label> <input type="text" name="person[email]" id="email"></p>
<p><input type="submit" value="Submit" /></p>
</form>
<?php $person = $_POST['person']; ?>
<?php if ($person): ?>
<p><strong>Person</strong> <?=$person['first_name'];?>, <?=$person['last_name'];?>, <?=$person['email'];?></p>
<?php endif; ?>
<hr>
<table>
<thead>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php foreach ($people as $person): ?>
<tr>
<td><?=$person['first_name'];?></td>
<td><?=$person['last_name'];?></td>
<td><?=$person['email'];?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</body>
</html>