Bonjour je me retrouve avec ce travail et j'ai besoin d'une aide pour que quand je clique sur une date le ou les films correspondant à cette date s'affiche. Je l'ai réalisé avec type="radio" mais je voudrais en fait que ce soit la date qui soit cliquable et pointe sur une colonne description du tableau ci-dessous.
0 =>array('movie'=>'Impitoyable','year'=>'1992','descriptions'=>'Retired Old West gunslinger William Munny reluctantly takes on one last job, with the help of his old partner and a young man.'),
1 =>array('movie'=>'Reservoir Dogs ', 'year' => '1992','descriptions' => 'When a simple jewelry heist goes horribly wrong, the surviving criminals begin to suspect that one of them is a police informant.'),
2 =>array('movie'=>'les evadés', 'year' => '1994', 'descriptions' => 'Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.'),
3 =>array('movie'=>' Fight Club ', 'year' => '1994','descriptions' => 'An insomniac office worker and a devil-may-care soapmaker form an underground fight club that evolves into something much, much more.'),
4 =>array('movie'=>' Forrest Gump', 'year' => '1994','descriptions' => 'The presidencies of Kennedy and Johnson, the events of Vietnam, Watergate, and other history unfold through the perspective of an Alabama man with'),
5 =>array('movie'=>' Léon', 'year' => '1994','descriptions' => 'Mathilda, a 12-year-old girl, is reluctantly taken in by Léon, a professional assassin, after her family is murdered. Léon and Mathilda form an unusual relationship, as she becomes his protégée and learns the assassin'),
6 =>array('movie'=>'La haine', 'year' => '1995','descriptions' => '24 hours in the lives of three young men in the French suburbs the day after a violent riot'),
7 =>array('movie'=>'Seven', 'year' => '1995','descriptions' => 'Two detectives, a rookie and a veteran, hunt a serial killer who uses the seven deadly sins as his motives'),
8 =>array('movie'=>' Usual Suspects', 'year' => '1995','descriptions' => 'A sole survivor tells of the twisty events leading up to a horrific gun battle on a boat, which began when five criminals met at a seemingly random police lineup'),
9 =>array('movie'=>'La vie est belle ', 'year' => '1997','descriptions' => 'When an open-minded Jewish librarian and his son become victims of the Holocaust, he uses a perfect mixture of will, humor, and imagination to protect his son from the dangers around their camp'),
10 =>array('movie'=>' Will Hunting', 'year'=>'1997','descriptions' => 'Will Hunting, a janitor at M.I.T., has a gift for mathematics, but needs help from a psychologist to find direction in his life.'),
11 =>array('movie'=>'Avengers: Infinity War', 'year'=>'2018','descriptions' => 'The Avengers and their allies must be willing to sacrifice all in an attempt to defeat the powerful Thanos before his blitz of devastation and ruin puts an end to the universe'),
12 =>array('movie'=>'Spider-Man: New Generation', 'year'=>'2018','descriptions' => 'Teen Miles Morales becomes Spider-Man of his reality, crossing his path with five counterparts from other dimensions to stop a threat for all realities'),
13 =>array('movie'=>'Capharnaum', 'year' => '2018','descriptions' => 'While serving a five-year sentence for a violent crime, a 12-year-old boy sues his parents for neglect'),
14 =>array('movie'=>'Dangal', 'year' => '2016','descriptions' => 'Former wrestler Mahavir Singh Phogat and his two wrestler daughters struggle towards glory at the Commonwealth Games in the face of societal oppression'),
15 =>array('movie'=>'Tu ne tueras point ','year' => '2016','descriptions' => 'World War II American Army Medic Desmond T. Doss, who served during the Battle of Okinawa, refuses to kill people, and becomes the first man in American history to receive the Medal of Honor without firing a shot'),
16 =>array('movie'=>'Mademoiselle', 'year' => '2016','descriptions' => 'A woman is hired as a handmaiden to a Japanese heiress, but secretly she is involved in a plot to defraud her'),
); if (isset($_GET['choice'])) { $choice = $_GET['choice'] ; foreach ($movings as $select) { if ($select['year'] == $choice) {
echo '<pre>'; echo 'l\'annee de votre choix est: '. $choice ; echo '. le titre du film :'.($select['movie']); echo '. la description :'.($select['descriptions']); echo '</pre>';
Le message qui suit est une réponse automatique activée par un membre de l'équipe. Les réponses automatiques leur permettent d'éviter d'avoir à répéter de nombreuses fois la même chose, ce qui leur fait gagner du temps et leur permet de s'occuper des sujets qui méritent plus d'attention. Nous sommes néanmoins ouverts et si vous avez une question ou une remarque, n'hésitez pas à contacter la personne en question par Message Privé. Pour plus d'informations, nous vous invitons à lire les règles générales du forum
Merci de colorer votre code à l'aide du bouton Code
Les forums d'Openclassrooms disposent d'une fonctionnalité permettant de colorer et mettre en forme les codes source afin de les rendre plus lisibles et faciles à manipuler par les intervenants. Pour cela, il faut utiliser le bouton de l'éditeur, choisir un des langages proposés et coller votre code dans la zone prévue. Si vous utilisez l'éditeur de messages en mode Markdown, il faut utiliser les balises <pre class="brush: php;">Votre code ici</pre>.
<pre class="brush: php;"><!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>FILM</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>RECHERCHE DE FILM</h1>
<form action="index.php" method="get">
<fieldset>
<p>
<label> Liste des années:<br></label>
<br>
<input type="radio" name="choice" value="1992">1992<br/>
<input type="radio" name="choice" value="1994">1994 <br />
<input type="radio" name="choice" value="1995">1995 <br />
<input type="radio" name="choice" value="1997">1997 <br />
<input type="radio" name="choice" value="2016">2016 <br />
<input type="radio" name="choice" value="2018">2018 <br />
<br>
<input type="submit">
</p>
</fieldset>
</form>
</body>
</html>
<?php
$movings = array(
0 =>array('movie'=>'Impitoyable','year'=>'1992','descriptions'=>'Retired Old West gunslinger William Munny reluctantly takes on one last job, with the help of his old partner and a young man.'),
1 =>array('movie'=>'Reservoir Dogs ', 'year' => '1992','descriptions' => 'When a simple jewelry heist goes horribly wrong, the surviving criminals begin to suspect that one of them is a police informant.'),
2 =>array('movie'=>'les evadés', 'year' => '1994', 'descriptions' => 'Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.'),
3 =>array('movie'=>' Fight Club ', 'year' => '1994','descriptions' => 'An insomniac office worker and a devil-may-care soapmaker form an underground fight club that evolves into something much, much more.'),
4 =>array('movie'=>' Forrest Gump', 'year' => '1994','descriptions' => 'The presidencies of Kennedy and Johnson, the events of Vietnam, Watergate, and other history unfold through the perspective of an Alabama man with'),
5 =>array('movie'=>' Léon', 'year' => '1994','descriptions' => 'Mathilda, a 12-year-old girl, is reluctantly taken in by Léon, a professional assassin, after her family is murdered. Léon and Mathilda form an unusual relationship, as she becomes his protégée and learns the assassin'),
6 =>array('movie'=>'La haine', 'year' => '1995','descriptions' => '24 hours in the lives of three young men in the French suburbs the day after a violent riot'),
7 =>array('movie'=>'Seven', 'year' => '1995','descriptions' => 'Two detectives, a rookie and a veteran, hunt a serial killer who uses the seven deadly sins as his motives'),
8 =>array('movie'=>' Usual Suspects', 'year' => '1995','descriptions' => 'A sole survivor tells of the twisty events leading up to a horrific gun battle on a boat, which began when five criminals met at a seemingly random police lineup'),
9 =>array('movie'=>'La vie est belle ', 'year' => '1997','descriptions' => 'When an open-minded Jewish librarian and his son become victims of the Holocaust, he uses a perfect mixture of will, humor, and imagination to protect his son from the dangers around their camp'),
10 =>array('movie'=>' Will Hunting', 'year'=>'1997','descriptions' => 'Will Hunting, a janitor at M.I.T., has a gift for mathematics, but needs help from a psychologist to find direction in his life.'),
11 =>array('movie'=>'Avengers: Infinity War', 'year'=>'2018','descriptions' => 'The Avengers and their allies must be willing to sacrifice all in an attempt to defeat the powerful Thanos before his blitz of devastation and ruin puts an end to the universe'),
12 =>array('movie'=>'Spider-Man: New Generation', 'year'=>'2018','descriptions' => 'Teen Miles Morales becomes Spider-Man of his reality, crossing his path with five counterparts from other dimensions to stop a threat for all realities'),
13 =>array('movie'=>'Capharnaum', 'year' => '2018','descriptions' => 'While serving a five-year sentence for a violent crime, a 12-year-old boy sues his parents for neglect'),
14 =>array('movie'=>'Dangal', 'year' => '2016','descriptions' => 'Former wrestler Mahavir Singh Phogat and his two wrestler daughters struggle towards glory at the Commonwealth Games in the face of societal oppression'),
15 =>array('movie'=>'Tu ne tueras point ','year' => '2016','descriptions' => 'World War II American Army Medic Desmond T. Doss, who served during the Battle of Okinawa, refuses to kill people, and becomes the first man in American history to receive the Medal of Honor without firing a shot'),
16 =>array('movie'=>'Mademoiselle', 'year' => '2016','descriptions' => 'A woman is hired as a handmaiden to a Japanese heiress, but secretly she is involved in a plot to defraud her'),
);
if (isset($_GET['choice'])) {
$choice = $_GET['choice'] ;
foreach ($movings as $select)
{
if ($select['year'] == $choice)
{
echo '<pre>';
echo 'l\'annee de votre choix est: '. $choice ;
echo '. le titre du film :'.($select['movie']);
echo '. la description :'.($select['descriptions']);
echo '</pre>';
}
}
}
?></pre>
Avant de poster un message, vérifiez la date du sujet dans lequel vous comptiez intervenir.
Si le dernier message sur le sujet date de plus de deux mois, mieux vaut ne pas répondre. En effet, le déterrage d'un sujet nuit au bon fonctionnement du forum, et l'informatique pouvant grandement changer en quelques mois il n'est donc que rarement pertinent de déterrer un vieux sujet.
Au lieu de déterrer un sujet il est préférable :
soit de contacter directement le membre voulu par messagerie privée en cliquant sur son pseudonyme pour accéder à sa page profil, puis sur le lien "Ecrire un message"
soit de créer un nouveau sujet décrivant votre propre contexte
ne pas répondre à un déterrage et le signaler à la modération
Je ferme ce sujet. En cas de désaccord, me contacter par MP.
Développeur react freelance à Toulouse
Je suis développeur react freelance spécialisé dans la création de site internet basé à Toulouse