Files
contribEvo/public/index.php

40 lines
974 B
PHP
Raw Permalink Normal View History

2025-10-10 08:57:59 +02:00
<?php
2025-10-10 10:58:21 +02:00
session_start();
// require_once __DIR__."/../utils_inc/inc_pdo.php"; placé dans le routeur
2025-10-10 10:21:27 +02:00
require_once __DIR__."/../controller/AuthController.php";
2025-10-10 08:57:59 +02:00
2025-10-10 10:58:21 +02:00
$pdo = new PDO('mysql:host=mysqlsrv;dbname=contrib', "contrib_root", "123abc");
2025-10-10 10:21:27 +02:00
define("BASE_URL","/contribEvo/");
2025-10-10 08:57:59 +02:00
2025-10-10 10:21:27 +02:00
//index.php?route=maRoute&param1=truc
// => receive get route
2025-10-10 08:57:59 +02:00
2025-10-10 10:21:27 +02:00
$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();
2025-10-10 10:58:21 +02:00
$ctr->handleConnForm($pdo);
2025-10-10 10:21:27 +02:00
exit();
}
2025-10-10 10:58:21 +02:00
echo"UNKNOWN ROUTE ALERT ALERT ALERT";