-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path10.results.php
46 lines (44 loc) · 1.11 KB
/
10.results.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
44
45
46
<?php
if ($_GET['submit'] != 'Show Wines') {
header("Location: 10.html_form.php");
exit;
}
require_once('10.wines.php');
$regionName = $_GET['regionName'];
$wines = getWines($regionName);
?>
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Exploring Wines in a Region</title>
</head>
<body bgcolor="white">
<?php
if (isset($regionName) && $regionName != 'All') {
echo "Wines of {$regionName}<br/>\n";
}
?>
<table>
<tr>
<th>Wine ID</th>
<th>Wine Name</th>
<th>Year</th>
<th>Winery</th>
<th>Description</th>
</tr>
<?php foreach($wines as $wine): ?>
<tr>
<td><?php echo $wine['wine_id']; ?></td>
<td><?php echo $wine['wine_name']; ?></td>
<td><?php echo $wine['year']; ?></td>
<td><?php echo $wine['winery_name']; ?></td>
<td><?php echo $wine['description']; ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php echo count($wines); ?> records found matching your criteria
</body>
</html>