-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathordforklaring.php
More file actions
50 lines (43 loc) · 1.68 KB
/
ordforklaring.php
File metadata and controls
50 lines (43 loc) · 1.68 KB
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
<?php
require_once('head.inc.php');
require_once('setdefault.inc.php');
require_once('formatter.inc.php');
makeheadstart('Ordforklaring');
makeheadend();
makemenus(-1);
mb_internal_encoding('UTF-8');
?>
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-10 col-xl-9">
<div class="card mt-4">
<div class="card-body">
<h1 class="card-title">Ordforklaring</h1>
<?php if (!isset($_GET['ord'])): ?>
<p class="card-text bg-warning">Manglende parameter.</p>
<?php elseif (strstr($_GET['ord'],'/')): ?>
<p class="card-text bg-warning">Ulovlig parameter.</p>
<?php else: ?>
<?php
$ord = $_GET['ord'][-1]=='.' ? mb_substr($_GET['ord'],0,-1) : $_GET['ord'];
$file = 'ordforkl/' . mb_strtolower($ord) . '.txt';
if (!file_exists($file))
$file = 'ordforkl/' . mb_strtolower($ord) . '.html';
?>
<div style="font-size: <?= $_SESSION['fontsize'] ?>%">
<?php if (!file_exists($file)): ?>
<p class="card-text bg-warning">Ordforklaring findes ikke.</p>
<?php else: ?>
<?= FormatText::replaceit_ordforkl($file) ?>
<?php endif; ?>
</div>
<?php endif; ?>
<a class="btn btn-secondary" href="#" onclick="window.history.go(-1)">Tilbage</a>
</div>
</div>
</div>
</div><!--End of row-->
</div><!--End of container-->
<?php
endbody();
?>