-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (46 loc) · 1.31 KB
/
Copy pathindex.php
File metadata and controls
54 lines (46 loc) · 1.31 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
51
52
53
54
<?php
// Déplacer toute la logique PHP en haut du fichier
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Nettoyage strict du paramètre 'page'
$allowed_pages = ['default', 'contact', 'especes', 'association'];
$page = isset($_GET['page']) && in_array($_GET['page'], $allowed_pages) ? $_GET['page'] : 'default';
// Fonction pour inclure les pages dynamiquement
function include_page($page) {
$filename = "Pages/" . $page . ".php";
if (file_exists($filename)) {
include($filename);
} else {
include("Pages/default.php");
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<?php include("includes/meta-index.php"); ?>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FWQP42TVR2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-FWQP42TVR2');
</script>
</head>
<body>
<?php include("includes/header.php"); ?>
<section class="main-content">
<!-- Contenu principal -->
<article>
<?php
// Inclut la page dynamique
include_page($page);
?>
</article>
</section>
<?php include("includes/footer.php"); ?>
<script src="/moteurs/paw-trails.js"></script>
</body>
</html>