-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
39 lines (26 loc) · 1.23 KB
/
index.php
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
<?php
include_once 'function/bdd.php';
include_once 'function/utils.php';
include_once 'class/Client.php';
include_once 'class/Livraison.php';
include_once 'class/Livreur.php';
include_once 'class/Produit.php';
include_once 'function/geo.php';
$lat1 = 48.8459535;
$long1 = 2.354859;
$lat2 = 48.8404955;
$long2 = 2.2560035;
$basePath = "http://" . $_SERVER["SERVER_NAME"] . "/livraison-app-webservice/";
// si une page est demandée avec '?p=pageDemandee' (dans l'url)
if(isset($_GET['json']) && !empty($_GET['json']) && preg_match("/^[a-zA-Z0-9-]+$/i",$_GET['json'])){
$p = htmlspecialchars(htmlentities($_GET['json']));
// Vérifie si le fichier existe avant inclusion
if(file_exists('controller/' . $p . 'Controller.php')){
include_once 'controller/' . $p . 'Controller.php'; // Inclusion du controller de la page
}else{// sinon renvoi une erreur si la requete n'existe pas
include_once 'controller/errorController.php'; // Inclusion du controller error
}
} else {
include_once 'controller/errorController.php'; // Inclusion du controller error
}
?>