diff --git a/R3.01/tp/tp2/ex1/ex1.php b/R3.01/tp/tp2/ex1/ex1.php
index 351ce8a..c28dd0f 100644
--- a/R3.01/tp/tp2/ex1/ex1.php
+++ b/R3.01/tp/tp2/ex1/ex1.php
@@ -1,26 +1,27 @@
-
-
+
+
+
-
-
-
-
-
-
-
- $prenom $nom";
- echo " ";
- ?>
-
-
-
+
+
+ Exercice 1
+
+
+
+
+ ' . htmlspecialchars($prenom . ' ' . $nom, ENT_QUOTES, 'UTF-8') . '';
+ echo '- ' . htmlspecialchars($systeme, ENT_QUOTES, 'UTF-8') . "
";
+ ?>
+
+
+
diff --git a/R3.01/tp/tp2/ex1/include/controller.php b/R3.01/tp/tp2/ex1/include/controller.php
index d8e50ed..07d5eab 100644
--- a/R3.01/tp/tp2/ex1/include/controller.php
+++ b/R3.01/tp/tp2/ex1/include/controller.php
@@ -1,2 +1,27 @@
['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'];
+ }
+}