Rev 35 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | daniel-mar | 1 | <?php |
2 | daniel-mar | 2 | |
26 | daniel-mar | 3 | /* |
4 | * MAC interpreter for PHP |
||
5 | * Copyright 2017 - 2023 Daniel Marschall, ViaThinkSoft |
||
6 | * Version 2023-07-11 |
||
7 | * |
||
8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
9 | * you may not use this file except in compliance with the License. |
||
10 | * You may obtain a copy of the License at |
||
11 | * |
||
12 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
13 | * |
||
14 | * Unless required by applicable law or agreed to in writing, software |
||
15 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
17 | * See the License for the specific language governing permissions and |
||
18 | * limitations under the License. |
||
19 | */ |
||
20 | |||
14 | daniel-mar | 21 | header('Content-Type:text/html; charset=utf-8'); |
22 | |||
32 | daniel-mar | 23 | $mac = isset($_GET['mac']) ? trim($_GET['mac']) : ''; |
24 | |||
14 | daniel-mar | 25 | ?><html> |
26 | |||
2 | daniel-mar | 27 | <head> |
14 | daniel-mar | 28 | <meta charset="UTF-8"> |
2 | daniel-mar | 29 | <link rel="stylesheet" type="text/css" href="style.css"> |
30 | <title>Interprete a MAC address</title> |
||
35 | daniel-mar | 31 | <meta name=viewport content="width=device-width, initial-scale=1"> |
2 | daniel-mar | 32 | </head> |
33 | |||
34 | <body> |
||
35 | |||
36 | <h1>Interprete a MAC address</h1> |
||
37 | |||
38 | <p><a href="index.php">Back</a></p> |
||
39 | |||
32 | daniel-mar | 40 | <?php |
2 | daniel-mar | 41 | |
32 | daniel-mar | 42 | echo '<form method="GET" action="interprete_mac.php">'; |
36 | daniel-mar | 43 | echo ' MAC: <input type="text" name="mac" value="'.htmlentities($mac).'" style="width:250px"> <input type="submit" value="Interprete">'; |
32 | daniel-mar | 44 | echo '</form>'; |
45 | |||
46 | echo '<pre>'; |
||
47 | |||
5 | daniel-mar | 48 | include_once __DIR__ . '/includes/mac_utils.inc.php'; |
2 | daniel-mar | 49 | |
50 | if (!mac_valid($mac)) { |
||
51 | echo 'This is not a valid MAC address.'; |
||
52 | } else { |
||
15 | daniel-mar | 53 | decode_mac($mac); |
2 | daniel-mar | 54 | } |
55 | |||
56 | ?></pre> |
||
57 | |||
25 | daniel-mar | 58 | <br> |
59 | |||
2 | daniel-mar | 60 | </body> |
61 | |||
62 | </html> |