Blame view

index.php 1.75 KB
392aea79   Jean Wasilewski   Added database na...
1
  <?php
1e17bb7e   Jean Wasilewski   Added session var...
2
  session_start();
392aea79   Jean Wasilewski   Added database na...
3
  require_once("creds.php");
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
4
  
bfaa212b   Geoffrey PREUD'HOMME   $page definition ...
5
6
7
8
9
  $url = $_SERVER["REQUEST_URI"];
  $parsedUrl = parse_url($url);
  $path = $parsedUrl['path'];
  $explodedUrl = explode('/', $path);
  $page = end($explodedUrl);
847ea853   Geoffrey PREUD'HOMME   Ensure no .php ha...
10
  $page = str_replace('.php', '', $page);
3fe59fff   Geoffrey PREUD'HOMME   Quick sanitization
11
  $page = str_replace('.', '', $page); // TODO Better sanitization
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
12
  
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
13
14
  if ($page == '') {
  	$page = 'home';
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
15
16
  }
  
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
17
18
19
20
  $toLoad = "pages/$page.php";
  
  // TODO Test if exists, 404 otherwise
  
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
21
  if (isset($_GET['c'])) {
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
22
  	require_once("$toLoad");
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
23
  } else {
392aea79   Jean Wasilewski   Added database na...
24
  ?>
75be0f8b   Jean Wasilewski   Doctype test
25
  <!DOCTYPE>
83cfb6f1   Jean Wasilewski   Initial scheme
26
27
  <html>
  	<head>
66d6b134   Jean Wasilewski   Added viewport meta
28
  		<meta name="viewport" content="width=device-width, initial-scale=1.0">
d8c7aa8a   Jean Wasilewski   UTF8 encoding
29
  		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
f9e2f87a   Jean Wasilewski   Header completed
30
  		<meta http-equiv="X-UA-Compatible" content="IE=edge">
096a903b   Jean Wasilewski   Description and a...
31
32
  		<meta name="description" content="Site Web de la Coupe de Robotique des Ecoles Primaires">
  		<meta name="author" content="Club Informatique de PolytechLille">
5f0258d5   Geoffrey PREUD'HOMME   Title too long
33
  		<title>Coupe de Robotique des Ecoles Primaires</title>
3d7135c9   henyxia   Now trying with t...
34
  		<link rel="stylesheet" href="css/bootstrap.css">
fc27b313   Jean Wasilewski   Added paffing for...
35
  		<link rel="stylesheet" href="css/crep.css">
ffb39cc5   Geoffrey PREUD'HOMME   Ajout d'un favicon
36
  		<link rel="shortcut icon" href="favicon.ico"/>
07793ced   henyxia   Contact page
37
  		<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js"></script>
f9e2f87a   Jean Wasilewski   Header completed
38
  		<script type="text/javascript" src="js/jquery.js"></script>
3d7135c9   henyxia   Now trying with t...
39
  		<script type="text/javascript" src="js/bootstrap.min.js"></script>
527066b7   Jean Wasilewski   Added whirlpool j...
40
  		<script type="text/javascript" src="js/whirlpool.min.js"></script>
56c75c13   Geoffrey PREUD'HOMME   [Navigation] Ouvr...
41
  		<script type="text/javascript" src="js/crep.js"></script>
a0daba42   Jean Wasilewski   Partial base64 an...
42
  		<script type="text/javascript" src="js/base64.js"></script>
83cfb6f1   Jean Wasilewski   Initial scheme
43
44
  	</head>
  	<body>
389dfe1b   Jean Wasilewski   Fixed issue with ...
45
  <?php require_once("topnavbar.php");?>
f9e2f87a   Jean Wasilewski   Header completed
46
  <?php require_once("menu.php");?>
cf13ef6c   henyxia   New menu
47
48
  		<div class="col-md-12 center-block">
  			<div class="col-md-12" id="mainContainer">
bce06567   Geoffrey PREUD'HOMME   Static PHP naviga...
49
  <?php
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
50
  	require_once("$toLoad");
bce06567   Geoffrey PREUD'HOMME   Static PHP naviga...
51
  ?>
f9e2f87a   Jean Wasilewski   Header completed
52
53
  			</div>
  		</div>
f57188db   henyxia   New footer
54
55
56
  &nbsp;
  &nbsp;
  <?php require_once("footer.php");?>
83cfb6f1   Jean Wasilewski   Initial scheme
57
  	</body>
389dfe1b   Jean Wasilewski   Fixed issue with ...
58
  </html>
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
59
60
61
62
  
  <?php
  }
  ?>