40 lines
974 B
PHP
40 lines
974 B
PHP
<?php
|
|
session_start();
|
|
// require_once __DIR__."/../utils_inc/inc_pdo.php"; placé dans le routeur
|
|
require_once __DIR__."/../controller/AuthController.php";
|
|
|
|
$pdo = new PDO('mysql:host=mysqlsrv;dbname=contrib', "contrib_root", "123abc");
|
|
|
|
define("BASE_URL","/contribEvo/");
|
|
|
|
//index.php?route=maRoute¶m1=truc
|
|
// => receive get route
|
|
|
|
$route = isset($_GET["route"])? $_GET["route"] : null;
|
|
|
|
/*
|
|
if (isset($_GET["route"])) {
|
|
$route = $_GET["route"]
|
|
} else {
|
|
$route = null;
|
|
}
|
|
*/
|
|
if ($route=="helloworld") {
|
|
$ctr = new AuthController();
|
|
$ctr->helloWorld();
|
|
exit();
|
|
}
|
|
|
|
if ($route=="displayConnForm") {
|
|
$ctr = new AuthController();
|
|
$ctr->displayConnForm();
|
|
exit();
|
|
}
|
|
|
|
if ($route=="handleConnForm") {
|
|
$ctr = new AuthController();
|
|
$ctr->handleConnForm($pdo);
|
|
exit();
|
|
}
|
|
|
|
echo"UNKNOWN ROUTE ALERT ALERT ALERT"; |