-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsearchprocessor.php
More file actions
70 lines (56 loc) · 1.26 KB
/
Copy pathsearchprocessor.php
File metadata and controls
70 lines (56 loc) · 1.26 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
<?php
//20180403 km4ack
//this page is called by search.php
//and is used to process the date input on
//the search.php page.
//edited 20180407
//include variables from config.php
include('/var/www/html/config.php');
//verify that something has been entered in the search box
if(empty(trim($_POST['search'])))
{
// Its empty so throw a validation error
echo 'Input is empty!';
header('LOCATION:search.php'); die();
}
else
{
// Input has some text and is not empty.. process accordingly..
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Search Results</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>
<h1><?php echo $callsign ?> Emergency Email Server<br>
<div id="pagelabel">Search For Replies</h1>
<hr><br>
<?php echo "<h3><strong>$time Current Time</strong></h3>" ?>
</div>
<h2>
<?php echo"$message" ?>
</h2><br><br>
<div>
Replies are listed below. If nothing is listed, then no replies have been received.
<br><br>
<?php
$search = $_POST["search"];
$path = "./replies/";
$files = glob($path . "*" . $search . "*". ".php");
$i=1;
foreach($files as $file)
{
echo "<a href='/$file'>$file</a><br /><br />";
$i++;
}
?>
</div>
<form action="search.php">
<input type="submit" value="Search Again" />
</form>
</body>
</html>