Authentication works

This commit is contained in:
BRAMAS Arthur
2025-10-10 10:21:27 +02:00
parent df07d7f42f
commit ee976b8a6e
6 changed files with 137 additions and 32 deletions

View File

@@ -1,36 +1,34 @@
<?php
require_once __DIR__."/../controller/AuthController.php";
?>
define("BASE_URL","/contribEvo/");
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<title>Connexion</title>
</head>
//index.php?route=maRoute&param1=truc
// => receive get route
<body class="container">
<div class="row justify-content-center">
<div class="col-md-4">
<form id="formLogin" action="traitements/traiterAuthentification.php" method="post">
<h3 class="text-center">Identifiez-vous</h3>
<div class="form-group">
<label for="id">Login :</label><br>
<input type="text" name="login" id="id" class="form-control">
</div>
<div class="form-group">
<label for="mdp">Pass :</label><br>
<input type="password" name="pass" id="mdp" class="form-control">
</div>
<br>
<div class="form-group text-end">
<input type="submit" name="submit" class="btn btn-primary btn-md" value="Valider">
</div>
</form>
</div>
</div>
</body>
</html>
$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();
exit();
}