add janky manpage search

This commit is contained in:
leah 2021-08-20 16:51:52 +01:00
parent cfe1720d35
commit a031e7c21d
1 changed files with 31 additions and 0 deletions

31
static/man.php Normal file
View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>the south london library</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='/main.css'>
</head>
<body>
<form method="get" name="commandform">
<input id="search"
class="search"
type="text"
name="command"
placeholder="&#128269; enter a command here">
<input type="submit" name="submit" style="display: none" />
</form>
<?php
$command = $_GET["command"];
echo $command;
$output=null;
$retval=null;
exec('man --html=cat ' . $command , $output, $retval);
echo "Returned with status $retval and output:\n";
foreach ($output as $line): ?>
<?=$line?>
<?php endforeach;?>
</body>
</html>