correction-ulysse (#2)

# Correction pour les TP1 TP2 et TP3

Je n'ai pas testé la connexion à la DB pour le moment car je ne peux pas me co sur https://dwarves.iut-fbleau.fr/phpmyadmin

Co-authored-by: JARNOUEN DE VILLARTAY Ulysse (SAFRAN AIRCRAFT ENGINES) <ulysse.jarnouen-de-villartay@safrangroup.com>
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-04-15 15:34:46 +02:00
parent 045ec81ae2
commit a4580652f8
22 changed files with 692 additions and 215 deletions
+26 -1
View File
@@ -1,2 +1,27 @@
<?php
// TODO
$nom = '';
$prenom = '';
$systeme = '';
$icon = 'fa-circle-question';
$systemes = [
1 => ['nom' => 'Linux', 'icon' => 'fa-linux'],
2 => ['nom' => 'Windows', 'icon' => 'fa-windows'],
3 => ['nom' => 'macOS', 'icon' => 'fa-apple'],
4 => ['nom' => 'Android', 'icon' => 'fa-android'],
];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$nomSaisi = trim((string) filter_input(INPUT_POST, 'nom', FILTER_UNSAFE_RAW));
$prenomSaisi = trim((string) filter_input(INPUT_POST, 'prenom', FILTER_UNSAFE_RAW));
$os = filter_input(INPUT_POST, 'os', FILTER_VALIDATE_INT);
$nom = ucfirst(strtolower($nomSaisi));
$prenom = ucfirst(strtolower($prenomSaisi));
if (isset($systemes[$os])) {
$systeme = $systemes[$os]['nom'];
$icon = $systemes[$os]['icon'];
}
}