diff --git a/R3.01/tp/tp1/README.md b/R3.01/tp/tp1/README.md new file mode 100644 index 0000000..4beaf6d --- /dev/null +++ b/R3.01/tp/tp1/README.md @@ -0,0 +1,233 @@ + +# TP1 : bases du langage PHP + +**À l'IUT** + +Le repertoire `public_html` à la racine de votre compte est accessible par http(s) à l'url suivante : + +``` +http[s]://dwarves.iut-fbleau.fr/~login/ +``` + +**Ailleurs** + +Pour monter ce repertoire dans votre aborescence locale, vous pouvez utiliser le programme `sshfs` : +``` +sshfs login@gatekeeper.iut-fbleau.fr:/export/home/an19/login repertoire/de/montage/local/ +``` + +Depuis la version 5.4, la commande `php` embarque un serveur web interne : + +```bash +php -S localhost:8080 -t repertoire +``` + +Le repertoire passé en paramètre est la racine du serveur web. + + +### Ex1 +Vous allez tester votre premier script php : `hello_world` : + ```php + + + + hello world";?> + + + ``` + + - Placez le fichier `hello_world.php` dans votre + repertoire `public_html`, et testez. + + - En utilisant la fonction `phpinfo`, faites afficher dans le script + précédent la configuration php du serveur dwarves. + +### Ex2 +Quel est l'entier servant de clé à + - chaque élément du tableau + suivant : + ```php + "Paul", + 2 =>"Martin", + "Arnaud" + ]; + ?> + ``` + + - à l'élément de valeur `Blouson` dans le tableau `$produits` ? + ```php + "Chemise", + 3 => "Pantalon", + 10 => "Jupe", + "Veste", + "Blouson" + ]; + ?> + ``` + - à chaque élément du tableau `$array` ? + ```php + + ``` +### Ex21 +- Créez un tableau de 10 cases dont la clé i contient la somme des entiers jusqu'à i. +- Créez un tableau de 10 cases dont la clé i2 contient i +. +### Ex22 +Écrivez un script php affichant les entiers de 1 à 50. +- Faites en sorte que les impairs soient en italique, et les pairs en gras. +- Regroupez chaque dizaine dans un même paragraphe. + +### Ex3 +Vous disposez du fichier [data.php](./ex3/include/data.inc.php) qui +représente, sous forme d'un tableau, un certain nombre +d'individus, avec pour chacun ses nom, prénom, email, taille et +poids. + +Voici un extrait du fichier : +```php +$data = array( +array("Nom"=>"Garza","Prenom"=>"Forrest","Email"=>"eleifend@ligulaedu","Taille"=>"185","Poids"=>"65"), +array("Nom"=>"Tanner","Prenom"=>"Orla","Email"=>"adipiscing@vitaecouk","Taille"=>"180","Poids"=>"73"), +... +``` + +1. Ecrire un script qui affichent l'ensemble des données sous + forme d'un tableau html. +2. L'imc (indice de masse corporel) d'une personne est donné par + la formule $\frac{poids}{taille^2}$ (poids en kilogramme et taille en mètre). + Ajouter une colonne avec la valeur de l'imc (2 chiffres après la virgule). +3. Une personne est considérée en surpoids lorsque son imc + dépasse 25. Colorier les lignes du tableau lorsque la + personne correspondante est en surpoids. + ![tableau](./ex3/img/tableau_ex3.png) + +
Conseils +
+ +- Pour utiliser le fichier de données, incluez-le dans votre + script. +- La structure de langage `foreach` fournit une façon simple de + parcourir des tableaux. `foreach` ne fonctionne que pour les + tableaux et les objets, et émettra une erreur si vous tentez de + l'utiliser sur une variable de type différent ou une variable + non initialisée. Il existe deux syntaxes : + + ```php + foreach (array_expression as $value){ + + } + + foreach (array_expression as $key => $value){ + + } + ``` + + Des [exemples]](http://fr2.php.net/manual/fr/control-structures.foreach.php). + +- Pour arrondir un réel, vous pouvez utiliser la fonction [round](https://www.php.net/manual/fr/function.round.php). +
+
+ +### Ex4 +Ecrivez un script qui permet de lancer deux dés, et en affiche la somme. Utilisez la fonction [mt_rand](https://www.php.net/manual/en/function.mt-rand.php) pour la génération aléatoire. + + + ![tableau](./ex4/img/exo4.png) + +### Ex5 +Ecrire un programme PHP qui affiche, sous forme d'une liste +"cliquable" vos bookmarks (favoris) stockés dans un tableau +associatif. Vos bookmarks seront classés par répertoire. Chaque +répertoire aura donc un nom, et contiendra un certain nombre de +favoris représentés par un nom, une image et une url. + +Exemple d'affichage : + +- Moteurs de recherche : + - [](http://google.fr). + - [](http://yahoo.fr). +- Journaux : + - [](http://lemonde.fr). + - [](http://www.unixgarden.com/index.php/category/gnu-linux-magazine). + - [](http://lequipe.fr). +- Sports : + - [](http://fff.fr). + - [](www.ffdf.fr). + +### Ex6 +Ecrire (et tester) une fonction + +```php + +``` + +qui permet de générer un mot de passe de `n` caractères choisis +aléatoirement parmi les caractères de `alphabet`. + +
Conseils + +Il suffit de tirer aléatoirement n caractères de la chaîne alphabet et de les concatener. + +Les fonctions +[strlen](https://www.php.net/manual/fr/function.strlen.php) +et +[mt_rand](https://www.php.net/manual/fr/function.mt-rand.php) pourront vous être utiles. +
+ +### Ex61 +On considère les deux tableaux suivants : + +```php +$tabMagazines = [ + 'le monde' => ['frequence' => 'quotidien', 'type' => 'actualité', 'prix' => 220], + 'le point' => ['frequence' => 'hebdo' , 'type' => 'actualité', 'prix' => 80 ], + 'causette' => ['frequence' => 'mensuel' , 'type' => 'féminin' , 'prix' => 180], + 'politis' => ['frequence' => 'hebdo' , 'type' => 'opinion' , 'prix' => 100], + 'le monde diplomatique' => ['frequence' => 'mensuel' , 'type' => 'analyse' , 'prix' => 60 ], + 'libération' => ['frequence' => 'quotidien', 'type' => 'actualité', 'prix' => 190], +]; + +$tabMagazinesAbonne = ['le monde', 'le monde diplomatique']; +``` + + +1. Afficher sur une ligne le nom de tous les magazines triés par ordre alphabétique et séparés par des virgules, sans faire de boucle. + Vous utiliserez des fonctions déjà existantes telles que [implode](https://www.php.net/manual/en/function.implode.php), [sort](https://www.php.net/manual/en/function.sort.php) et [array_keys](https://www.php.net/manual/en/function.array-keys.php) que vous trouverez dans le manuel php. +2. Afficher séparés par des virgule les noms des quotidiens (et uniquement ceux-ci). +3. Afficher les magazines exactement de la façon suivante en supposant qu’il peut y avoir beaucoup de magazines et beaucoup de propriétés associées : + - le monde (quotidien, actualité, 220) + - le point (hebdo, actualité, 80) + - causette (mensuel, féministe, 180) + - politis (hebdo, opinion, 100) + - le monde diplomatique (mensuel, analyse, 60) +4. En utilisant le tableau `$tabMagazinesAbonne` contenant le nom des magazines d’un abonné, calculer le prix total de son abonnement. + +### Ex7 +On reprend l'exercice 3. + +1. Ajouter une colonne de clé `Imc` aux personnes du tableau `$data`. On utilisera la fonction +[array_map](https://www.php.net/manual/fr/function.array-map.php). +2. Trier `$data` par ordre croissant d'imc. On utilisera la fonction [usort](https://www.php.net/manual/fr/function.usort.php). +3. Calculer l'imc moyen de l'ensemble des personnes. On utilisera la fonction [array_reduce](https://www.php.net/manual/fr/function.array-reduce.php). + + +### Ex8 +1. Allez voir la page manuel PHP de [scandir](https://www.php.net/manual/en/function.scandir). + Quel(s) sont ses arguments ? Que renvoie-t-elle ? +2. Utilisez scandir pour afficher des liens vers les autres fichiers de votre dossier public_html. On rappelle + que la balise html `a` permet de créer des hyperliens. +3. Utilisez la méthode [str_ends_with](https://www.php.net/manual/en/function.str-ends-with.php) pour n’afficher que les scripts PHP. + +Par ailleurs, une liste des fonctions sur les chaînes de caractères est disponible [ici](https://www.php.net/ref.strings). diff --git a/R3.01/tp/tp1/ex1/hello-world.php b/R3.01/tp/tp1/ex1/hello-world.php new file mode 100644 index 0000000..11a784f --- /dev/null +++ b/R3.01/tp/tp1/ex1/hello-world.php @@ -0,0 +1,9 @@ + + + + hello world !!!"; + //phpinfo(); + ?> + + diff --git a/R3.01/tp/tp1/ex2/index.php b/R3.01/tp/tp1/ex2/index.php new file mode 100644 index 0000000..90e8baa --- /dev/null +++ b/R3.01/tp/tp1/ex2/index.php @@ -0,0 +1,26 @@ + "Paul", + 2 =>"Martin", + "Arnaud" +]; + +$produits = [ + 20 => "Chemise", + 3 => "Pantalon", + 10 => "Jupe", + "Veste", + "Blouson" +]; +$array = ["a","b","c"]; +$array[] = "d"; +$array[10] = "j"; +unset($array[2]); + +echo "
";
+print_r($clients);
+print_r($produits);
+print_r($array);
+echo "
"; +?> diff --git a/R3.01/tp/tp1/ex3/css/style.css b/R3.01/tp/tp1/ex3/css/style.css new file mode 100644 index 0000000..625f60b --- /dev/null +++ b/R3.01/tp/tp1/ex3/css/style.css @@ -0,0 +1,3 @@ +.warning tr,.warning td { + background-color : rgb(255,154,0); +} diff --git a/R3.01/tp/tp1/ex3/img/tableau_ex3.png b/R3.01/tp/tp1/ex3/img/tableau_ex3.png new file mode 100644 index 0000000..056318c Binary files /dev/null and b/R3.01/tp/tp1/ex3/img/tableau_ex3.png differ diff --git a/R3.01/tp/tp1/ex3/include/data.inc.php b/R3.01/tp/tp1/ex3/include/data.inc.php new file mode 100644 index 0000000..6b1e569 --- /dev/null +++ b/R3.01/tp/tp1/ex3/include/data.inc.php @@ -0,0 +1,106 @@ +"Garza","Prenom"=>"Forrest","Email"=>"eleifend@ligulaedu","Taille"=>"185","Poids"=>"65"), + array("Nom"=>"Tanner","Prenom"=>"Orla","Email"=>"adipiscing@vitaecouk","Taille"=>"180","Poids"=>"73"), + array("Nom"=>"Griffith","Prenom"=>"Susan","Email"=>"condimentum@tristiqueca","Taille"=>"172","Poids"=>"75"), + array("Nom"=>"Wilkinson","Prenom"=>"Carla","Email"=>"tinciduntaliquamarcu@utmolestieca","Taille"=>"178","Poids"=>"71"), + array("Nom"=>"Kirkland","Prenom"=>"Vladimir","Email"=>"Donec@egettinciduntduiorg","Taille"=>"178","Poids"=>"73"), + array("Nom"=>"Holloway","Prenom"=>"Joy","Email"=>"enim@Nullamca","Taille"=>"191","Poids"=>"67"), + array("Nom"=>"Soto","Prenom"=>"Cleo","Email"=>"posuereatvelit@Incondimentumca","Taille"=>"167","Poids"=>"70"), + array("Nom"=>"Jacobson","Prenom"=>"Linda","Email"=>"disparturientmontes@metusurnaconvallisnet","Taille"=>"169","Poids"=>"73"), + array("Nom"=>"Wilder","Prenom"=>"Ina","Email"=>"odiovel@eratcouk","Taille"=>"167","Poids"=>"68"), + array("Nom"=>"Pace","Prenom"=>"Melvin","Email"=>"euismodindolor@DonecestNuncca","Taille"=>"175","Poids"=>"68"), + array("Nom"=>"Moody","Prenom"=>"Hayden","Email"=>"ornareelit@malesuadaIntegeridedu","Taille"=>"180","Poids"=>"63"), + array("Nom"=>"Rhodes","Prenom"=>"Jarrod","Email"=>"turpis@placeratnet","Taille"=>"168","Poids"=>"68"), + array("Nom"=>"Bean","Prenom"=>"Marah","Email"=>"suscipitest@ullamcorperDuiscursusnet","Taille"=>"165","Poids"=>"61"), + array("Nom"=>"Beard","Prenom"=>"Dylan","Email"=>"nonmagna@mollisnet","Taille"=>"173","Poids"=>"62"), + array("Nom"=>"Davenport","Prenom"=>"September","Email"=>"amet@purusca","Taille"=>"179","Poids"=>"67"), + array("Nom"=>"Boyd","Prenom"=>"Natalie","Email"=>"Aeneangravidanunc@metusorg","Taille"=>"179","Poids"=>"62"), + array("Nom"=>"Davidson","Prenom"=>"Kane","Email"=>"ullamcorpermagnaSed@eutemporcouk","Taille"=>"181","Poids"=>"67"), + array("Nom"=>"Burch","Prenom"=>"Tanek","Email"=>"a@Vivamussitorg","Taille"=>"169","Poids"=>"69"), + array("Nom"=>"Talley","Prenom"=>"Leo","Email"=>"musAeneaneget@ornareliberoatcom","Taille"=>"167","Poids"=>"72"), + array("Nom"=>"Stephens","Prenom"=>"Simone","Email"=>"in@auctorodioacom","Taille"=>"170","Poids"=>"65"), + array("Nom"=>"Haynes","Prenom"=>"Gloria","Email"=>"liberoettristique@diamvelarcucouk","Taille"=>"169","Poids"=>"70"), + array("Nom"=>"Blanchard","Prenom"=>"Faith","Email"=>"massa@augueeutellusnet","Taille"=>"166","Poids"=>"62"), + array("Nom"=>"Randall","Prenom"=>"Blaze","Email"=>"atpede@blanditNamnullacom","Taille"=>"163","Poids"=>"66"), + array("Nom"=>"Griffith","Prenom"=>"Roary","Email"=>"aliquetmetus@velnislcouk","Taille"=>"162","Poids"=>"64"), + array("Nom"=>"Morgan","Prenom"=>"Tanner","Email"=>"egetlaoreet@arcucouk","Taille"=>"179","Poids"=>"67"), + array("Nom"=>"Chapman","Prenom"=>"Amelia","Email"=>"nunc@massaQuisquecom","Taille"=>"164","Poids"=>"69"), + array("Nom"=>"Grant","Prenom"=>"Chloe","Email"=>"auctorMauris@loremegetorg","Taille"=>"173","Poids"=>"72"), + array("Nom"=>"Richardson","Prenom"=>"Ryan","Email"=>"scelerisque@ullamcorpermagnacouk","Taille"=>"173","Poids"=>"64"), + array("Nom"=>"Cleveland","Prenom"=>"Yeo","Email"=>"acsem@vehiculaca","Taille"=>"163","Poids"=>"69"), + array("Nom"=>"Gay","Prenom"=>"Amanda","Email"=>"fames@idsapienedu","Taille"=>"165","Poids"=>"63"), + array("Nom"=>"Peters","Prenom"=>"Bruno","Email"=>"ornaretortor@condimentumDonecatcom","Taille"=>"163","Poids"=>"66"), + array("Nom"=>"Lambert","Prenom"=>"Dean","Email"=>"sapien@sitametrisuscouk","Taille"=>"180","Poids"=>"71"), + array("Nom"=>"Petty","Prenom"=>"Nigel","Email"=>"pedeSuspendisse@risusDuiscouk","Taille"=>"168","Poids"=>"66"), + array("Nom"=>"Phelps","Prenom"=>"Cullen","Email"=>"euaugue@Vestibulumanteca","Taille"=>"159","Poids"=>"76"), + array("Nom"=>"Cochran","Prenom"=>"Marny","Email"=>"Lorem@enimconsequatpuruscouk","Taille"=>"157","Poids"=>"67"), + array("Nom"=>"Bauer","Prenom"=>"Sloane","Email"=>"nisi@liberonet","Taille"=>"174","Poids"=>"72"), + array("Nom"=>"Strong","Prenom"=>"Leigh","Email"=>"ut@Aliquamcouk","Taille"=>"176","Poids"=>"65"), + array("Nom"=>"Olsen","Prenom"=>"Herrod","Email"=>"uteratSed@rutrumloremedu","Taille"=>"167","Poids"=>"72"), + array("Nom"=>"Spears","Prenom"=>"Bruno","Email"=>"congueturpis@nullaorg","Taille"=>"162","Poids"=>"77"), + array("Nom"=>"Pearson","Prenom"=>"Marah","Email"=>"Donecatarcu@aedu","Taille"=>"174","Poids"=>"62"), + array("Nom"=>"Moore","Prenom"=>"Orson","Email"=>"semegetmassa@puruscouk","Taille"=>"189","Poids"=>"76"), + array("Nom"=>"Roman","Prenom"=>"Kylie","Email"=>"habitant@duiaugueca","Taille"=>"177","Poids"=>"66"), + array("Nom"=>"Michael","Prenom"=>"Ciaran","Email"=>"nostraper@nibhPhaselluscom","Taille"=>"156","Poids"=>"65"), + array("Nom"=>"Sheppard","Prenom"=>"Colton","Email"=>"enim@inaliquetedu","Taille"=>"159","Poids"=>"70"), + array("Nom"=>"Mathews","Prenom"=>"Pamela","Email"=>"auctor@Praesenteuedu","Taille"=>"168","Poids"=>"74"), + array("Nom"=>"Thompson","Prenom"=>"Olga","Email"=>"vel@egestascom","Taille"=>"173","Poids"=>"75"), + array("Nom"=>"Petersen","Prenom"=>"Jared","Email"=>"urna@Crasvulputatevelitca","Taille"=>"173","Poids"=>"75"), + array("Nom"=>"Leblanc","Prenom"=>"Aurora","Email"=>"dictum@egetcom","Taille"=>"164","Poids"=>"72"), + array("Nom"=>"Blanchard","Prenom"=>"Keiko","Email"=>"Suspendisse@torquentperconubiacouk","Taille"=>"167","Poids"=>"72"), + array("Nom"=>"Sharp","Prenom"=>"Barrett","Email"=>"Proineget@laoreetposuereedu","Taille"=>"163","Poids"=>"72"), + array("Nom"=>"Hughes","Prenom"=>"Orson","Email"=>"utdolor@risusDonecegestasnet","Taille"=>"159","Poids"=>"62"), + array("Nom"=>"Porter","Prenom"=>"Ava","Email"=>"Fuscedolor@Nuncnet","Taille"=>"178","Poids"=>"70"), + array("Nom"=>"Figueroa","Prenom"=>"Lesley","Email"=>"Quisquenonummy@eulacusorg","Taille"=>"168","Poids"=>"68"), + array("Nom"=>"Wyatt","Prenom"=>"Zelenia","Email"=>"sitametultricies@accumsansedfacilisiscom","Taille"=>"174","Poids"=>"61"), + array("Nom"=>"Stark","Prenom"=>"Sarah","Email"=>"natoquepenatibuset@neccursusacom","Taille"=>"167","Poids"=>"67"), + array("Nom"=>"Carney","Prenom"=>"Ariana","Email"=>"enimsit@nuncinterdumfeugiatorg","Taille"=>"180","Poids"=>"78"), + array("Nom"=>"Simmons","Prenom"=>"Herrod","Email"=>"ac@estnet","Taille"=>"172","Poids"=>"72"), + array("Nom"=>"Mayo","Prenom"=>"Carissa","Email"=>"Nulla@quamquisca","Taille"=>"182","Poids"=>"60"), + array("Nom"=>"Higgins","Prenom"=>"Serena","Email"=>"anteblanditviverra@aliquetPhasellusfermentumedu","Taille"=>"178","Poids"=>"71"), + array("Nom"=>"Fletcher","Prenom"=>"Remedios","Email"=>"Phaselluselitpede@consequatcouk","Taille"=>"180","Poids"=>"73"), + array("Nom"=>"Green","Prenom"=>"Dale","Email"=>"libero@temporeratorg","Taille"=>"171","Poids"=>"68"), + array("Nom"=>"White","Prenom"=>"Jack","Email"=>"velconvallis@anteedu","Taille"=>"172","Poids"=>"73"), + array("Nom"=>"Russo","Prenom"=>"Giselle","Email"=>"nonnisi@luctusvulputateorg","Taille"=>"160","Poids"=>"69"), + array("Nom"=>"James","Prenom"=>"Kimberley","Email"=>"malesuadafamesac@nuncsitametcom","Taille"=>"191","Poids"=>"72"), + array("Nom"=>"Huffman","Prenom"=>"Thomas","Email"=>"Nuncmauriselit@Pellentesqueca","Taille"=>"168","Poids"=>"68"), + array("Nom"=>"Turner","Prenom"=>"Cody","Email"=>"lorem@elitcouk","Taille"=>"172","Poids"=>"73"), + array("Nom"=>"Neal","Prenom"=>"Cheryl","Email"=>"nequevitaesemper@rhoncusidcom","Taille"=>"170","Poids"=>"68"), + array("Nom"=>"Patel","Prenom"=>"Hamilton","Email"=>"ametultriciessem@nonantebibendumedu","Taille"=>"172","Poids"=>"79"), + array("Nom"=>"Alexander","Prenom"=>"Grant","Email"=>"nonnisiAenean@massacom","Taille"=>"174","Poids"=>"68"), + array("Nom"=>"Shepherd","Prenom"=>"Tad","Email"=>"ac@inorg","Taille"=>"165","Poids"=>"76"), + array("Nom"=>"Wynn","Prenom"=>"Danielle","Email"=>"lectusquismassa@InfaucibusMorbiorg","Taille"=>"169","Poids"=>"66"), + array("Nom"=>"Pollard","Prenom"=>"Ahmed","Email"=>"velarcu@Nullaegetorg","Taille"=>"164","Poids"=>"62"), + array("Nom"=>"Peters","Prenom"=>"Hollee","Email"=>"loremipsum@sitametca","Taille"=>"177","Poids"=>"75"), + array("Nom"=>"Alston","Prenom"=>"Brendan","Email"=>"antebibendumullamcorper@idblanditcouk","Taille"=>"156","Poids"=>"68"), + array("Nom"=>"Keith","Prenom"=>"Vernon","Email"=>"diam@sagittisnet","Taille"=>"168","Poids"=>"70"), + array("Nom"=>"Rodgers","Prenom"=>"Angela","Email"=>"pharetra@vellectusCumcom","Taille"=>"171","Poids"=>"65"), + array("Nom"=>"Parker","Prenom"=>"Tatiana","Email"=>"penatibusetmagnis@scelerisquesedca","Taille"=>"173","Poids"=>"68"), + array("Nom"=>"Miller","Prenom"=>"Timothy","Email"=>"tinciduntcongue@atca","Taille"=>"178","Poids"=>"66"), + array("Nom"=>"Wilder","Prenom"=>"Rosalyn","Email"=>"mauris@aliquameuorg","Taille"=>"165","Poids"=>"67"), + array("Nom"=>"Baker","Prenom"=>"Sheila","Email"=>"sitametrisus@euplacerategetcouk","Taille"=>"178","Poids"=>"69"), + array("Nom"=>"Lee","Prenom"=>"Roary","Email"=>"nequenon@acouk","Taille"=>"159","Poids"=>"61"), + array("Nom"=>"Gillespie","Prenom"=>"Quemby","Email"=>"nonenimcommodo@lobortiscom","Taille"=>"167","Poids"=>"61"), + array("Nom"=>"Dixon","Prenom"=>"Zenaida","Email"=>"risus@etmagnisdisca","Taille"=>"170","Poids"=>"72"), + array("Nom"=>"Holden","Prenom"=>"Chloe","Email"=>"in@elementumorg","Taille"=>"169","Poids"=>"76"), + array("Nom"=>"Rios","Prenom"=>"Stone","Email"=>"consequatenim@enimMaurisca","Taille"=>"169","Poids"=>"77"), + array("Nom"=>"Berg","Prenom"=>"Sara","Email"=>"faucibusleo@Maurisblanditenimorg","Taille"=>"162","Poids"=>"63"), + array("Nom"=>"Clay","Prenom"=>"Timon","Email"=>"etultrices@necorg","Taille"=>"168","Poids"=>"72"), + array("Nom"=>"Schneider","Prenom"=>"Knox","Email"=>"dolor@liberoca","Taille"=>"165","Poids"=>"65"), + array("Nom"=>"Cervantes","Prenom"=>"Pandora","Email"=>"metusVivamuseuismod@ligulaca","Taille"=>"179","Poids"=>"73"), + array("Nom"=>"Allen","Prenom"=>"Micah","Email"=>"dolorsitamet@nonhendreritorg","Taille"=>"176","Poids"=>"75"), + array("Nom"=>"Kirkland","Prenom"=>"Jolie","Email"=>"Fuscemollis@Nuncullamcorperorg","Taille"=>"154","Poids"=>"66"), + array("Nom"=>"Woodard","Prenom"=>"Quincy","Email"=>"idliberoDonec@Phasellusnullaca","Taille"=>"166","Poids"=>"69"), + array("Nom"=>"Peck","Prenom"=>"Octavius","Email"=>"lobortis@semperegestasurnaca","Taille"=>"167","Poids"=>"68"), + array("Nom"=>"Andrews","Prenom"=>"Wade","Email"=>"sedpede@mifelisorg","Taille"=>"158","Poids"=>"64"), + array("Nom"=>"Kennedy","Prenom"=>"Lydia","Email"=>"Vestibulumaccumsanneque@ipsumnuncidnet","Taille"=>"178","Poids"=>"67"), + array("Nom"=>"Velez","Prenom"=>"Erin","Email"=>"sagittisDuisgravida@nonduineccouk","Taille"=>"167","Poids"=>"66"), + array("Nom"=>"Hendrix","Prenom"=>"Sopoline","Email"=>"asollicitudin@etcouk","Taille"=>"173","Poids"=>"74"), + array("Nom"=>"Boyd","Prenom"=>"Neville","Email"=>"nuncidenim@vehiculaPellentesquetinciduntcom","Taille"=>"173","Poids"=>"75"), + array("Nom"=>"Rice","Prenom"=>"Lois","Email"=>"nonmassanon@Aeneanca","Taille"=>"166","Poids"=>"58"), + array("Nom"=>"Lloyd","Prenom"=>"Aline","Email"=>"dapibusgravida@utmolestieinedu","Taille"=>"145","Poids"=>"80") +); + +?> diff --git a/R3.01/tp/tp1/ex3/index.php b/R3.01/tp/tp1/ex3/index.php new file mode 100644 index 0000000..f031367 --- /dev/null +++ b/R3.01/tp/tp1/ex3/index.php @@ -0,0 +1,38 @@ + + + + + + + tp1 - ex3 + + + + +
+

Exercice 3 : IMC

+ + + + + + + + + + + + + + + + +
NomPrénomEmailTaillePoidsIMC
+
+ + diff --git a/R3.01/tp/tp1/ex4/css/style.css b/R3.01/tp/tp1/ex4/css/style.css new file mode 100644 index 0000000..3d34c6c --- /dev/null +++ b/R3.01/tp/tp1/ex4/css/style.css @@ -0,0 +1,7 @@ +img{ + width : 10rem; + margin:2rem; +} +.is-center{ + text-align : center; +} diff --git a/R3.01/tp/tp1/ex4/img/dice-six-faces-five.svg b/R3.01/tp/tp1/ex4/img/dice-six-faces-five.svg new file mode 100644 index 0000000..4af7ea3 --- /dev/null +++ b/R3.01/tp/tp1/ex4/img/dice-six-faces-five.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/R3.01/tp/tp1/ex4/img/dice-six-faces-four.svg b/R3.01/tp/tp1/ex4/img/dice-six-faces-four.svg new file mode 100644 index 0000000..639a1eb --- /dev/null +++ b/R3.01/tp/tp1/ex4/img/dice-six-faces-four.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/R3.01/tp/tp1/ex4/img/dice-six-faces-one.svg b/R3.01/tp/tp1/ex4/img/dice-six-faces-one.svg new file mode 100644 index 0000000..22d744d --- /dev/null +++ b/R3.01/tp/tp1/ex4/img/dice-six-faces-one.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/R3.01/tp/tp1/ex4/img/dice-six-faces-six.svg b/R3.01/tp/tp1/ex4/img/dice-six-faces-six.svg new file mode 100644 index 0000000..2cbe95c --- /dev/null +++ b/R3.01/tp/tp1/ex4/img/dice-six-faces-six.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/R3.01/tp/tp1/ex4/img/dice-six-faces-three.svg b/R3.01/tp/tp1/ex4/img/dice-six-faces-three.svg new file mode 100644 index 0000000..f068788 --- /dev/null +++ b/R3.01/tp/tp1/ex4/img/dice-six-faces-three.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/R3.01/tp/tp1/ex4/img/dice-six-faces-two.svg b/R3.01/tp/tp1/ex4/img/dice-six-faces-two.svg new file mode 100644 index 0000000..32129a8 --- /dev/null +++ b/R3.01/tp/tp1/ex4/img/dice-six-faces-two.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/R3.01/tp/tp1/ex4/img/exo4.png b/R3.01/tp/tp1/ex4/img/exo4.png new file mode 100644 index 0000000..e17b8ae Binary files /dev/null and b/R3.01/tp/tp1/ex4/img/exo4.png differ diff --git a/R3.01/tp/tp1/ex4/index.php b/R3.01/tp/tp1/ex4/index.php new file mode 100644 index 0000000..1db7b37 --- /dev/null +++ b/R3.01/tp/tp1/ex4/index.php @@ -0,0 +1,24 @@ + + + + + + + tp1 - ex4 + + + + +
+
Tirage aléatoire
+
+ + +
+
Somme =
+
+ + diff --git a/R3.01/tp/tp1/ex5/css/style.css b/R3.01/tp/tp1/ex5/css/style.css new file mode 100644 index 0000000..f016d7b --- /dev/null +++ b/R3.01/tp/tp1/ex5/css/style.css @@ -0,0 +1,5 @@ +img{ +height:15px; +vertical-align:middle; +margin:0; +} diff --git a/R3.01/tp/tp1/ex5/include/favoris.inc.php b/R3.01/tp/tp1/ex5/include/favoris.inc.php new file mode 100644 index 0000000..fe21226 --- /dev/null +++ b/R3.01/tp/tp1/ex5/include/favoris.inc.php @@ -0,0 +1,29 @@ + [ + [ + "nom"=>"Google", + "url"=>"http://google.com", + "img"=>"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/272px-Google_2015_logo.svg.png" + ], + [ + "nom"=>"Yahoo", + "url"=>"http://yahoo.com", + "img"=>"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Yahoo%21_%282019%29.svg/200px-Yahoo%21_%282019%29.svg.png" + ] + ], + "Journaux" => [ + [ + "nom"=>"Le Monde", + "url"=>"http://lemonde.fr", + "img"=>"http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Le_monde_logo.svg/200px-Le_monde_logo.svg.png" + ], + [ + "nom"=>"L'equipe", + "url"=>"http://lequipe.fr", + "img"=>"http://upload.wikimedia.org/wikipedia/commons/3/32/L%27%C3%89quipe_wordmark.svg" + ] + ] +]; +?> diff --git a/R3.01/tp/tp1/ex5/index.php b/R3.01/tp/tp1/ex5/index.php new file mode 100644 index 0000000..2fa8b9b --- /dev/null +++ b/R3.01/tp/tp1/ex5/index.php @@ -0,0 +1,27 @@ + + + + + + + + tp1 - ex4 + + + + +
+

+ Exercice 4 : Favoris +

+ + + +
+ + diff --git a/R3.01/tp/tp1/ex6/include/fonction.php b/R3.01/tp/tp1/ex6/include/fonction.php new file mode 100644 index 0000000..10aaf04 --- /dev/null +++ b/R3.01/tp/tp1/ex6/include/fonction.php @@ -0,0 +1,7 @@ + diff --git a/R3.01/tp/tp1/ex6/index.php b/R3.01/tp/tp1/ex6/index.php new file mode 100644 index 0000000..b0fd03c --- /dev/null +++ b/R3.01/tp/tp1/ex6/index.php @@ -0,0 +1,35 @@ + + + + + + + + Exercice 5 + + + +
+
+

Exercice 5 : createPassword

+

+ Test de la fonction createPassword +

+
+
+ +
+
+ + +