summaryrefslogtreecommitdiffstats
path: root/contrib/errcode/errcode.php
blob: f4774f0367e6c38ed175f4422cf2b9d345b80ba6 (plain) (blame)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?
/*
 * Copyright (C) 2008 Stefan Hajnoczi <stefanha@gmail.com>.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

// The path to the errcode.py script.
$ERRCODE_PATH = './errcode.py';
?>

<html>
    <head>
        <title>iPXE Error Code Lookup</title>
        <style>
            body, pre, div, form, p, h2, b, tt {
                padding: 0;
                border: 0;
                margin: 0;
            }
            body {
                padding: 0.5em;
                width: 750px;
                font-family: sans-serif;
            }
            pre {
                margin: 0.2em;
                padding: 0.1em;
                background-color: #ddd;
            }
            form {
                margin: 0.2em;
            }
            div {
                margin: 0.2em;
                padding: 0.4em;
                border: 1px dashed black;
            }
        </style>
    </head>
    <body>
<?
if (!empty($_REQUEST['e']) && preg_match('/^(0x)?[0-9a-f]{8}$/', $_REQUEST['e'])) {
?>
        <pre>
<?
    system($ERRCODE_PATH . " " . $_REQUEST['e']);
?>
        </pre>
<?
}
?>
        <form action="" method="post">
            <label for="e">Error code:</label>
            <input type="text" name="e" id="e" value="0x12345678"></input>
            <input type="submit" value="Lookup"></input>
        </form>

        <div>
            <h2>Hint:</h2>
            <p>
            Firefox users can right-click on the <b>Error code</b>
            text box and select <b>Add a Keyword for this Search...</b>.
            Set <b>name</b> to <tt>iPXE Error Code Lookup</tt> and
            <b>keyword</b> to <tt>gxpe</tt>  Then you can look up error
            codes by typing something like the following in your address
            bar: <tt>ipxe 0x3c018003</tt>
            <p>
        </div>
    </body>
</html>