1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Saison par date </title>
<body>
<h1>Saison par date</h1>
<hr>
<h3>Insérez une date</h3>
<form action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<label for="txt_date">Entrez la date:</label><input type="date" name="txt_date" id="id_date"><br><br>
<input type="submit" value="Rechercher" id="id_rechercher" name="btn_Rechercher">
</form>
<hr>
<?php
function saison() {
$date = date('md');
if ($date >= '') {
$saison = 'Hiver';
}
elseif ($date >= '') {
$saison = 'Automne';
}
elseif ($date >= '') {
$saison = 'Été';
}
else {
$saison = 'Printemps';
}
return $saison;
}
if (isset($_POST['txt_date']))
{
$date=$_POST['txt_date'];
echo ("<p style=\"color:green\"> A cette date nous serons en ou au ".saison($saison)."</p>");
}
?>
</body>
</head>
</html> |
Partager