-
Notifications
You must be signed in to change notification settings - Fork 0
/
facts.php
51 lines (43 loc) · 1.3 KB
/
facts.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
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<title>Fun Facts</title>
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<!-- Facts came from https://www.infoplease.com/us/states/fifty-states-and-fifty-fun-facts -->
<header>
<?php include "css/navbar.php";?>
</header>
<div id="flexBox">
<div id="container">
<h1>50 States of Facts</h1>
<form action="" id="form2">
<div class="search_box">
<input type="text" id="search">
<input type="button" id="submit_form" onclick="checkInput()" value="Search">
</div>
</form>
<script>
function checkInput() {
var query = document.getElementById('search').value;
window.find(query);
return true;
}
</script>
<table id="factTable">
<tr>
<th>Facts</th>
</tr>
<?php
$filename = "facts.txt";
$facts = file("facts.txt");
foreach ($facts as $fact) {
echo "<tr><td>" . $fact . "</td></tr>";
}
?>
</table>
</div>
</div>
</body>
</html>