Affiché text, en fonction de liste déroulante
bip
-
bip -
bip -
Bonjour,
Voila, enfaite je voudrais afficher un text (sur la mm page deja ouverte) en fonction du choix du user avec la liste déroulante.
CHOIX 1 ---> text 1
CHOIX 2 ---> text 2
etc...
voila mon code, mais sa ne marche pas, ca m'affiche mon message d'erreur :(
merci de m'aider
<?php
echo '<p>Choisissez un pays:</p>';
echo"<form name='form1' action='juniors.php' method='POST'>";
echo ' <select name="ADrent" id="menuadherents">';
$resultat=mysql_query("select nompays from pays order by nompays") or die ("Requête non executée.");
while ($ligne=mysql_fetch_array($resultat))
{
echo '<option>'.$ligne["nompays"].'</option>';
}
echo '</select>';
echo '<input type="submit" value="Afficher" name="go">';
echo '</form>';
$_GET['ADrent']=$ligne["nompays"];
$ADrent=$_GET['ADrent'];
//Les lignes suivantes affichent le détail d'un adhérent
// si l'utilisateur en a choisi un
$resultat2 = mysql_query("Select * from pays where nompays=".$ADrent) or die ("Requête 2 non executée.");
$ligne2 = mysql_fetch_array($resultat2);
echo "<br>";
echo "<br>";
echo ' <b>Adhérent : </b>'.$ligne2['nompays'].' '.$ligne2['codepays'].' '.$ligne2['description'].'<br>';
?>
Voila, enfaite je voudrais afficher un text (sur la mm page deja ouverte) en fonction du choix du user avec la liste déroulante.
CHOIX 1 ---> text 1
CHOIX 2 ---> text 2
etc...
voila mon code, mais sa ne marche pas, ca m'affiche mon message d'erreur :(
merci de m'aider
<?php
echo '<p>Choisissez un pays:</p>';
echo"<form name='form1' action='juniors.php' method='POST'>";
echo ' <select name="ADrent" id="menuadherents">';
$resultat=mysql_query("select nompays from pays order by nompays") or die ("Requête non executée.");
while ($ligne=mysql_fetch_array($resultat))
{
echo '<option>'.$ligne["nompays"].'</option>';
}
echo '</select>';
echo '<input type="submit" value="Afficher" name="go">';
echo '</form>';
$_GET['ADrent']=$ligne["nompays"];
$ADrent=$_GET['ADrent'];
//Les lignes suivantes affichent le détail d'un adhérent
// si l'utilisateur en a choisi un
$resultat2 = mysql_query("Select * from pays where nompays=".$ADrent) or die ("Requête 2 non executée.");
$ligne2 = mysql_fetch_array($resultat2);
echo "<br>";
echo "<br>";
echo ' <b>Adhérent : </b>'.$ligne2['nompays'].' '.$ligne2['codepays'].' '.$ligne2['description'].'<br>';
?>
A voir également:
- Affiché text, en fonction de liste déroulante
- Liste déroulante excel - Guide
- Liste déroulante en cascade - Guide
- Fonction si et - Guide
- Texte de chanson gratuit pdf - Télécharger - Vie quotidienne
- Liste de diffusion whatsapp - Guide