-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
42 lines (38 loc) · 929 Bytes
/
Copy pathprocess.php
File metadata and controls
42 lines (38 loc) · 929 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
32
33
34
35
36
37
38
39
40
41
42
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$input = escapeshellarg($_POST["input"]);
$output = shell_exec("./query " . $input);
$html_part1 = '
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Result</title>
<style>
table {
margin: auto;
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 8px;
border: 1px solid black;
text-align: center;
}
</style>
</head>
<body>
<table border-style="dotted">
<tr>
<th>Document ID</th>
<th>Score</th>
</tr>';
$html_part2 = '
</table>
</body>
</html>';
echo $html_part1 . $output . $html_part2;
} else {
echo "Invalid request.";
}
?>