Skip to content

Instantly share code, notes, and snippets.

@cladjidane
Created May 2, 2023 13:01
Show Gist options
  • Save cladjidane/95c0c05544a477ca767b25ee1b4c8154 to your computer and use it in GitHub Desktop.
Save cladjidane/95c0c05544a477ca767b25ee1b4c8154 to your computer and use it in GitHub Desktop.
<?php
/**
* \\Author: Thibault Napoléon "Imothep"
* \\Company: ISEN Yncréa Ouest
* \\Email: [email protected]
* \\Created Date: 05-Apr-2023 - 12:25:38
* \\Last Modified: 13-Apr-2023 - 10:26:05
*/
define('CHARACTERS', array('*', '#', 'o', 'x'));
?>
<!doctype html>
<html lang="fr">
<head>
<!-- Meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="Thibault Napoléon">
<!-- Title -->
<title>TP n°4 - Premiers pas PHP</title>
</head>
<body>
<h1>TP n°4 - Premiers pas PHP</h1>
<hr>
<!-- Premiers pas -->
<h2>Premiers pas</h2>
<?php
echo 'Bonjour '.$_GET['name'].', nous sommes le '.date('d/m/Y').', il est '.date('H:i:s');
?>
<br><br>
<!-- Premier formulaire -->
<h2>Premier formulaire</h2>
<form action="process_f1.php" method="POST">
<h3>Nous aimerions mieux vous connaître :</h3>
<label for="languages">Quelles langues parlez-vous (utilisez la touche <i>CTRL</i> pour en choisir plusieurs) :</label>
<br><br>
<select name="languages[]" multiple="multiple" id="languages">
<option value="français">Français</option>
<option value="anglais">Anglais</option>
<option value="allemand">Allemand</option>
<option value="espagnol">Espagnol</option>
</select>
<br><br>
Quels sont vos compétences en informatique (choisir au minimum 2 langages) :
<br>
<label for="html">HTML</label>
<input type="checkbox" name="competences[]" value="HTML" id="html">&nbsp;
<label for="css">CSS</label>
<input type="checkbox" name="competences[]" value="CSS" id="css">&nbsp;
<label for="php">PHP</label>
<input type="checkbox" name="competences[]" value="PHP" id="php">&nbsp;
<label for="sql">SQL</label>
<input type="checkbox" name="competences[]" value="SQL" id="sql">&nbsp;
<label for="js">JavaScript</label>
<input type="checkbox" name="competences[]" value="JavaScript" id="js">&nbsp;
<label for="python">Python</label>
<input type="checkbox" name="competences[]" value="Python" id="python">&nbsp;
<label for="c">C</label>
<input type="checkbox" name="competences[]" value="C" id="c">&nbsp;
<label for="cpp">C++</label>
<input type="checkbox" name="competences[]" value="C++" id="cpp">
<br><br>
<input type="reset" value="Effacer">
<input type="submit" value="Envoyer">
</form>
<br>
<!-- Second formulaire -->
<h2>Second formulaire</h2>
<form action="process_f2.php" method="GET">
<h3>Dessin d'un triangle :</h3>
<label for="size">Longueur du coté :</label>
<input type="number" min="0" name="size" id="size">
<br>
<input type="radio" name="isFilled" id="v0" value="0" checked>&nbsp;
<label for="v0">Intérieur vide</label>
<input type="radio" name="isFilled" id="v1" value="1">&nbsp;
<label for="v1">Intérieur plein</label>
<br>
<label for="character">Caractère à utiliser :</label>
<select name="character" id="character">
<?php
foreach (CHARACTERS as $character)
echo '<option value="'.$character.'">'.$character.'</option>';
?>
</select>
<br><br>
<input type="reset" value="Effacer">
<input type="submit" value="Envoyer">
<form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment