Commit bce0656792220df66390e3790385bfa0269e67ec
1 parent
5f0258d5
Static PHP navigation
Showing
3 changed files
with
27 additions
and
6 deletions
Show diff stats
index.php
@@ -26,7 +26,25 @@ require_once("creds.php"); | @@ -26,7 +26,25 @@ require_once("creds.php"); | ||
26 | <?php require_once("menu.php");?> | 26 | <?php require_once("menu.php");?> |
27 | <div class="col-md-12 center-block"> | 27 | <div class="col-md-12 center-block"> |
28 | <div class="col-md-12" id="mainContainer"> | 28 | <div class="col-md-12" id="mainContainer"> |
29 | -<?php require_once("home.php");?> | 29 | +<?php |
30 | +$page = end(explode('/', $_SERVER["REQUEST_URI"])); | ||
31 | +switch ($page) { | ||
32 | + case 'home': | ||
33 | + case 'description': | ||
34 | + case 'sponsors': | ||
35 | + case 'schools': | ||
36 | + case 'contact': | ||
37 | + $toLoad = $page; | ||
38 | + break; | ||
39 | + case '': | ||
40 | + $toLoad = 'home'; | ||
41 | + break; | ||
42 | + default: | ||
43 | + $toLoad = '404'; | ||
44 | + break; | ||
45 | +} | ||
46 | +require_once("$toLoad.php"); | ||
47 | +?> | ||
30 | </div> | 48 | </div> |
31 | </div> | 49 | </div> |
32 | | 50 | |
menu.php
@@ -2,19 +2,19 @@ | @@ -2,19 +2,19 @@ | ||
2 | <div class="container-fluid"> | 2 | <div class="container-fluid"> |
3 | <ul class="nav navbar-nav"> | 3 | <ul class="nav navbar-nav"> |
4 | <li> | 4 | <li> |
5 | - <a href="#home" onClick="loadNewDoc('home.php');">Accueil</a> | 5 | + <a href="home">Accueil</a> |
6 | </li> | 6 | </li> |
7 | <li> | 7 | <li> |
8 | - <a href="#description" onClick="loadNewDoc('description.php');">Descritption</a> | 8 | + <a href="description">Descritption</a> |
9 | </li> | 9 | </li> |
10 | <li> | 10 | <li> |
11 | - <a href="#sponsors" onClick="loadNewDoc('sponsors.php');">Sponsors</a> | 11 | + <a href="sponsors">Sponsors</a> |
12 | </li> | 12 | </li> |
13 | <li> | 13 | <li> |
14 | - <a href="#schools" onClick="loadNewDoc('schools.phpDEBUG');">Ecoles participantes</a> | 14 | + <a href="schools">Ecoles participantes</a> |
15 | </li> | 15 | </li> |
16 | <li> | 16 | <li> |
17 | - <a href="#contact" onClick="loadNewDoc('contact.php');">Contact</a> | 17 | + <a href="contact">Contact</a> |
18 | </li> | 18 | </li> |
19 | </ul> | 19 | </ul> |
20 | </div> | 20 | </div> |