maj avant tp noté
This commit is contained in:
6
WEBBE/TP1/bonjour.php
Normal file
6
WEBBE/TP1/bonjour.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<?php echo "<h1>hello world</h1>";?>
|
||||
</body>
|
||||
</html>
|
50
WEBBE/TP2/exo1.php
Normal file
50
WEBBE/TP2/exo1.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<form action="/action_page.php" method="POST">
|
||||
<h2>Qui etes-vous ?</h2>
|
||||
<label for="surname">nom:</label><br>
|
||||
<input type="text" id="surname" name="surname" value=""><br>
|
||||
<label for="name">prenom:</label><br>
|
||||
<input type="text" id="name" name="name" value="">
|
||||
<br>
|
||||
<h2>Sexe :</h2>
|
||||
<input type="radio" name="sexe" id="Homme" value="Homme">
|
||||
<label for="Homme">Homme</label><br>
|
||||
<input type="radio" name="sexe" id="Femme" value="Femme">
|
||||
<label for="Femme">Femme</label><br>
|
||||
<input type="radio" name="sexe" id="nb" value="nb">
|
||||
<label for="nb">Non-Binaire</label><br>
|
||||
<input type="radio" name="sexe" id="other" value="other">
|
||||
<label for="other">other</label><br>
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
<br>
|
||||
<h2>
|
||||
<?php
|
||||
if(isset($_POST["surname"])&& isset($_POST["name"])&& isset($_POST["sexe"]))
|
||||
{
|
||||
$surname = $_POST["surname"];
|
||||
$name = $_POST["name"];
|
||||
$sexe = $_POST["sexe"];
|
||||
if($sexe=="Homme")
|
||||
{
|
||||
echo "Bonjour Monsieur $surname $name";
|
||||
}else{
|
||||
if($sexe=="Femme")
|
||||
{
|
||||
echo "Bonjour Monsieur $surname $name";
|
||||
}else{
|
||||
if($sexe=="nb")
|
||||
{
|
||||
echo "Bonjour $surname $name";
|
||||
}else{
|
||||
if($sexe=="other")
|
||||
{
|
||||
echo "Bonjour Monsieur/Madame $surname $name";
|
||||
}}}}
|
||||
}
|
||||
?>
|
||||
</h2>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user