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 46 47 48 49
| <!DOCTYPE>
<?php
$filmsList = array(
'1972' => '<center><h2> 1 / Les évadés</h2></center> Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.
<h2> 2 / Les évadés</h2> Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.',
'1973' => '<h2> Les évadés 2 </h2> Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.');
if (isset ($_GET['Rechercher']))
{
if (empty ($_GET['annee']))
{
echo '<h3>Veuillez selectionner au minimum une année pour débuter votre recherche.</h3>';
}
else
{
foreach($filmsList as $valeur)
{
if ($_GET['annee']=='1972')
{
echo $filmsList[1972];
}
if ($_GET['annee']=='1973')
{
echo $filmsList[1973];
}
break;
}
}
}
?>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Catalogue du film</title>
</head>
<body>
<center>
<form method="get">
<p>Bienvenue, notre site référence les films les plus célèbres de 1970 à 2018.</p>
<p>Insérez une année pour consulter les films liés.</p>
<TEXTAREA name="annee" rows=1 cols=5 placeholder="Année" maxlength="4" required></TEXTAREA>
<p>
<input name="Rechercher" type="submit" value="Rechercher">
</p>
</form>
</center>
</body>
</html> |