diff --git a/R3.01/README.md b/R3.01/README.md index 2636b66..dc0a2a4 100644 --- a/R3.01/README.md +++ b/R3.01/README.md @@ -31,6 +31,9 @@ Les notions suivantes seront abordées : | Semaine | Cours | TD/TP | | ------------------ | -------------------------------------------------------- | ------------------ | | 1 : 16/03 - 20/03| [Bases du langages](./cours/cm_bases_php.pdf) | | +| 2 : 23/03 - 27/03 | | [tp1](./tp/tp1) | +| 3 : 30/03 - 03/04 | [Intéractions avec le client](./cours/cm_interaction_client_serveur.pdf) | [tp2](./tp/tp2) | + ## Les TPS @@ -40,4 +43,10 @@ permet de se familiariser avec le langage PHP. À chaque exercice correspond un sous répertoire avec des fichiers à compléter. +#### TP2 : Intéractions avec le client, formulaires et PHP +Le [tp2](./tp/tp2) +aborde la récupération des données de formulaires avec PHP. +À chaque exercice correspond un sous répertoire avec +des fichiers à compléter. + diff --git a/R3.01/cours/cm_interaction_client_serveur.pdf b/R3.01/cours/cm_interaction_client_serveur.pdf new file mode 100644 index 0000000..89cbb5a Binary files /dev/null and b/R3.01/cours/cm_interaction_client_serveur.pdf differ diff --git a/R3.01/tp/tp2/README.md b/R3.01/tp/tp2/README.md new file mode 100644 index 0000000..b75bfd1 --- /dev/null +++ b/R3.01/tp/tp2/README.md @@ -0,0 +1,118 @@ +# TP 2 : Intéractions avec le client. Formulaires HTML et PHP. + + + +> On utilisera autant que possible les fonctions +[filter\_input](http://php.net/manual/fr/function.filter-input.php) ou +[filter\_var](http://php.net/manual/fr/function.filter-var.php) qui +permettent de valider le type (ou nettoyer) des entrées d'un formulaire +(entre autre). + +### Ex1. +Ecrire le script de traitement associé au formulaire (2 champs texte +pour le nom et prénom, quatre boutons radio pour choisir le système) qui +affiche les données saisies : + +
+ + +
+ +Faites en sorte que la première lettre (et elle seule) du prénom et +du nom soit en en majuscule. + +Vous pouvez utilisez les fonctions : + +```php +string strtolower ( string $string ); +string ucfirst ( string $str ); +``` + +### Ex2. +Ecrire un (seul) script qui saisit dans un champs texte un entier et +qui affiche la table de multiplication correspondante lors de la +soumission. + +
+ +
+ + +### Ex3. +Ecrire une petite calculatrice permettant d'effectuer des +opérations arithmétiques élémentaires (+,x,-,/) sur deux opérandes. + +
+ +
+ +1. Première version : affichez un formulaire permettant, dans + l'ordre, de saisir la première opérande, puis dans une liste + (`SELECT`) l'opération, enfin de saisir la deuxième opérande. + Associez à ce formulaire le script effectuant le calcul et + affichant le résultat. +2. Assurez-vous qu'on ne puisse pas diviser par 0. +3. Deuxième version : après un calcul, réaffichez le formulaire en + proposant comme valeur par défaut de la première opérande le + résultat du calcul précédent. + +### Ex4. +Vous diposez du fichier html `quizz.html`. Pour chaque question, il +n'y a qu'une réponse exacte. On vous demande d'écrire le script +php de traitement des réponses qui affiche au joueur le résultat du +jeu : + +
+ + +
+ + + +Regardez-bien comment est structuré le quizz (nom des variables, +valeurs transmises, etc ). Cela doit vous permettre d'écrire un +script php qui s'adaptera automatiquement si on rajoute ou on +enlève des questions au quizz. + +Evidemment, il est très facile de tricher ! + +### Ex5. +Vous disposez du formulaire suivant : + +
+ +
+ + + +- Un champ texte permet de saisir un verbe du premier groupe à + conjuguer. +- Des cases à cocher permettent de choisir les temps de + conjugaisons. + +Ecrire le script PHP qui receptionne les données **postées** par le +formulaire précédent, et qui affiche le verbe conjugué aux temps +choisis. + +
+ +
+ +
+Conseils +
+Pour extraire le radical, vous pouvez utiliser la +fonction substr + +```php +string substr ( string $string , int $start [, int $length ] ); +``` + +Vous pouvez également stocker dans un tableau associatif les +terminaisons possibles, ainsi que les pronoms personnels. + +```php +$terminaisons = array("present"=>array("e","es","e","ons","ez","ent"), ... +``` +
+
diff --git a/R3.01/tp/tp2/ex1/css/style.css b/R3.01/tp/tp2/ex1/css/style.css new file mode 100644 index 0000000..b299a7e --- /dev/null +++ b/R3.01/tp/tp2/ex1/css/style.css @@ -0,0 +1,3 @@ +form button{ +float:right; +} diff --git a/R3.01/tp/tp2/ex1/ex1.html b/R3.01/tp/tp2/ex1/ex1.html new file mode 100644 index 0000000..07149bc --- /dev/null +++ b/R3.01/tp/tp2/ex1/ex1.html @@ -0,0 +1,54 @@ + + + + + + + Exercice 1 + + + +
+

Exercice 1

+ +
+
+ Qui êtes-vous ? + + + + +
+ +
+ Système d'exploitation préféré + + + + +
+ + +
+
+ + diff --git a/R3.01/tp/tp2/ex1/ex1.php b/R3.01/tp/tp2/ex1/ex1.php new file mode 100644 index 0000000..351ce8a --- /dev/null +++ b/R3.01/tp/tp2/ex1/ex1.php @@ -0,0 +1,26 @@ + + + + + + + + + + + +
+ +
+ + diff --git a/R3.01/tp/tp2/ex1/include/controller.php b/R3.01/tp/tp2/ex1/include/controller.php new file mode 100644 index 0000000..d8e50ed --- /dev/null +++ b/R3.01/tp/tp2/ex1/include/controller.php @@ -0,0 +1,2 @@ + + + + + + + + + +
+

Table de multiplication

+
+ + +
+
+ + diff --git a/R3.01/tp/tp2/ex3/calculatrice.php b/R3.01/tp/tp2/ex3/calculatrice.php new file mode 100644 index 0000000..5b9b228 --- /dev/null +++ b/R3.01/tp/tp2/ex3/calculatrice.php @@ -0,0 +1,34 @@ + + + + + + + + + + + +
+

Calculatrice

+
+
+ + + + + + +
+ + diff --git a/R3.01/tp/tp2/ex3/css/style.css b/R3.01/tp/tp2/ex3/css/style.css new file mode 100644 index 0000000..539a218 --- /dev/null +++ b/R3.01/tp/tp2/ex3/css/style.css @@ -0,0 +1,6 @@ +input[type="text"], +select +{ +display:inline-block; +width:auto; +} diff --git a/R3.01/tp/tp2/ex3/include/controller.php b/R3.01/tp/tp2/ex3/include/controller.php new file mode 100644 index 0000000..e8fd322 --- /dev/null +++ b/R3.01/tp/tp2/ex3/include/controller.php @@ -0,0 +1,2 @@ + + + + + + + + + + + + +
+

Quizz

+
+
+ Quelle est la capitale de la France ? + + + + +
+
+ Quelle est le nombre suivant de la suite 1,2,4,8 ? + + + +
+
+ La bataille de Marignan a eu lieu en + + + +
+ + + + +
+
+ + diff --git a/R3.01/tp/tp2/ex4/score.php b/R3.01/tp/tp2/ex4/score.php new file mode 100644 index 0000000..30876c4 --- /dev/null +++ b/R3.01/tp/tp2/ex4/score.php @@ -0,0 +1,17 @@ + + + + + + + + +
+

Réponses

+ +
+ + diff --git a/R3.01/tp/tp2/ex5/conjuguer.php b/R3.01/tp/tp2/ex5/conjuguer.php new file mode 100644 index 0000000..507d322 --- /dev/null +++ b/R3.01/tp/tp2/ex5/conjuguer.php @@ -0,0 +1,23 @@ + + + + + + + + + + + + +
+ +
+ + + diff --git a/R3.01/tp/tp2/ex5/css/style.css b/R3.01/tp/tp2/ex5/css/style.css new file mode 100644 index 0000000..98648c5 --- /dev/null +++ b/R3.01/tp/tp2/ex5/css/style.css @@ -0,0 +1,4 @@ +input[type="text"]{ +width:auto; + +} diff --git a/R3.01/tp/tp2/ex5/ex5.html b/R3.01/tp/tp2/ex5/ex5.html new file mode 100644 index 0000000..f374c73 --- /dev/null +++ b/R3.01/tp/tp2/ex5/ex5.html @@ -0,0 +1,31 @@ + + + + + + + + + + +
+

Conjugaison

+
+
+ + Temps + + + +
+ + +
+
+ + diff --git a/R3.01/tp/tp2/ex5/include/controller.php b/R3.01/tp/tp2/ex5/include/controller.php new file mode 100644 index 0000000..f35c02d --- /dev/null +++ b/R3.01/tp/tp2/ex5/include/controller.php @@ -0,0 +1,12 @@ +array("e","es","e","ons","ez","ent"), + "futur"=>array("erai","eras","era","erons","erez","eront"), + "imparfait"=>array("ais","ais","ait","ions","iez","aient") +); + +$pronoms=array("je","tu","il","nous","vous","ils"); + +$verbe = filter_input(INPUT_POST,"verbe",FILTER_SANITIZE_STRING); +$radical = substr($verbe,0,strlen($verbe)-2); + diff --git a/R3.01/tp/tp2/img/exo1.png b/R3.01/tp/tp2/img/exo1.png new file mode 100644 index 0000000..15292ff Binary files /dev/null and b/R3.01/tp/tp2/img/exo1.png differ diff --git a/R3.01/tp/tp2/img/exo11.png b/R3.01/tp/tp2/img/exo11.png new file mode 100644 index 0000000..45c9762 Binary files /dev/null and b/R3.01/tp/tp2/img/exo11.png differ diff --git a/R3.01/tp/tp2/img/exo2.png b/R3.01/tp/tp2/img/exo2.png new file mode 100644 index 0000000..aa98fa3 Binary files /dev/null and b/R3.01/tp/tp2/img/exo2.png differ diff --git a/R3.01/tp/tp2/img/exo3.png b/R3.01/tp/tp2/img/exo3.png new file mode 100644 index 0000000..1adc0f7 Binary files /dev/null and b/R3.01/tp/tp2/img/exo3.png differ diff --git a/R3.01/tp/tp2/img/exo4.png b/R3.01/tp/tp2/img/exo4.png new file mode 100644 index 0000000..d452d30 Binary files /dev/null and b/R3.01/tp/tp2/img/exo4.png differ diff --git a/R3.01/tp/tp2/img/exo41.png b/R3.01/tp/tp2/img/exo41.png new file mode 100644 index 0000000..a3ad024 Binary files /dev/null and b/R3.01/tp/tp2/img/exo41.png differ diff --git a/R3.01/tp/tp2/img/exo5.png b/R3.01/tp/tp2/img/exo5.png new file mode 100644 index 0000000..d5419ad Binary files /dev/null and b/R3.01/tp/tp2/img/exo5.png differ diff --git a/R3.01/tp/tp2/img/exo51.png b/R3.01/tp/tp2/img/exo51.png new file mode 100644 index 0000000..5edd1bc Binary files /dev/null and b/R3.01/tp/tp2/img/exo51.png differ diff --git a/R3.01/tp/tp2/tp2.tar.gz b/R3.01/tp/tp2/tp2.tar.gz new file mode 100644 index 0000000..90ad382 Binary files /dev/null and b/R3.01/tp/tp2/tp2.tar.gz differ diff --git a/R4.01_R4.A.10/miniprojet/groupes.md b/R4.01_R4.A.10/miniprojet/groupes.md index f494e48..1389df8 100644 --- a/R4.01_R4.A.10/miniprojet/groupes.md +++ b/R4.01_R4.A.10/miniprojet/groupes.md @@ -1,19 +1,29 @@ ## Groupes projet -- Rayan Lankechari / Ibrahima Bah -- Demrici-Özmen Canpolat / Eliot Maxime -- Ozvann ABRAHAM / Karl FRAMERY -- SOLAR Dimitri / ZAABAY Tarehi -- Nicolas Miekisiak / Loïc Sainton -- Torreblanca Mathys / Poitou Enzo / Haffa BAKHOUCHE -- WIECZOREK Valentin / PLOUVIER Luka -- Kouami Kpeglo / Alexis Fort -- Ugo Faye / Mathis Leclere -- Nathan Couchot / Théo Anastasio / Adrien Rabot -- Pierre COURTEHOUX / Lukas SIMOES -- CAMILLE Cléo / Warrhen Roland -- Aylane Sehl / Séri-Khane / ?? -- Arwa Ben Fraj / Bounni Loubelo Benicia -- Hicham Cherifi / Wael Atik -- DERQSI BILAL / CAMILLE LECHAVLIER -- Ayoub ANHDIRE / Algassimou Pellel DIALLO -- Soraya Amina KHADIR/ Jéremy CAYRON + +> Chaque groupe vient 10 minutes avant son horaire. Le site et les sources +> sont consultables sur une machine de la salle pour le test. + +**Lundi 30/03** +- Rayan Lankechari / Ibrahima Bah (9h00 222) +- Demrici-Özmen Canpolat / Eliot Maxime (9h20 223) +- Ozvann ABRAHAM / Karl FRAMERY (9h40 222) +- SOLAR Dimitri / ZAABAY Tarehi (10h00 223) +- Nicolas Miekisiak / Loïc Sainton (10h20 222) +- Torreblanca Mathys / Poitou Enzo / Haffa BAKHOUCHE (10h40 223) +- WIECZOREK Valentin / PLOUVIER Luka (11H00 222) +- Kouami Kpeglo / Alexis Fort (11h20 223) +- Ugo Faye / Mathis Leclere (11h40 222) +- Nathan Couchot / Théo Anastasio / Adrien Rabot (12h00 223) + +**Jeudi 02/04** +- Yanis AMRANI, Jimmy COLOMB-RAVAT (13h45 223) +- Pierre COURTEHOUX / Lukas SIMOES (14h00 222) +- CAMILLE Cléo / Warrhen Roland (14h20 223) +- Aylane Sehl / Séri-Khane / ?? (14h40 222) +- Arwa Ben Fraj / Bounni Loubelo Benicia (15h00 223) +- Hicham Cherifi / Wael Atik (15h20 222) +- DERQSI BILAL / CAMILLE LECHAVLIER (15h40 223) +- Ayoub ANHDIRE / Algassimou Pellel DIALLO (16h00 222) +- Soraya Amina KHADIR/ Jéremy CAYRON (16h20 223) +- Yassine MABCHOUR (16h40 222) +- Mathys Tribeau / Boulalam Youness (17h00 223)