par
sam01 » 05 oct. 2011, 08:25
j'ai mis un champ hidden, comme vous me l'avez conseillé, mais c'est toujours pareil, la valeur $continent ne passe pas...
echo '<form method="get" action="'.$site.'liste.php" class="form01 type01" id="form01">';
echo '<div id="titreForm">'.$txt0140.'</div>';
echo '<div id="corpForm">';
echo '<fieldset id="coordonnees">';
echo '<legend>'.$txt0336.'</legend>';
echo '<p class="double">';
echo '<label for="f1-pays" class="oblig">'.$idem_txt0015;
echo '<span class="info"></span></label>';
echo '<select name="ad_pays" class="font">';
if (empty($data_dest['pays_'.$lang.'']))
{
echo '<option value="-1" selected="selected">'.$idem_txt0017.'</option>';
}
else
{
echo '<option value="-1">'.$idem_txt0017.'</option>';
}
// on se connecte à MySQL
include ('connect.php');
$sql_dest = sprintf("SELECT DISTINCT A.id_pay, A.pays_".$lang.", A.id_con, C.id_con, C.cont_".$lang."
FROM flatforswap_pays A
INNER JOIN flatforswap_continent C ON C.id_con = A.id_con
INNER JOIN flatforswap_ville B ON A.id_pay = B.id_pay
INNER JOIN flatforswap_adherent E ON E.id_vil = B.id_vil
WHERE E.valide = '2'
ORDER BY A.pays_".$lang." ASC");
$req_dest = mysql_query($sql_dest) or die('Erreur SQL !<br>'.$sql_dest.'<br>'.mysql_error());
while($data_dest = mysql_fetch_assoc($req_dest))
{
$selection = "";
$continent = "";
if ($ad_pays == $data_dest['pays_'.$lang.''])
{
$selection = 'selected="selected">';
$continent = '<input type="hidden" name="continent" value="'.$data_dest['cont_'.$lang.''].'">';
}
echo '<option value="'.$data_dest['pays_'.$lang.''].'" '.$selection.'>'.$data_dest['pays_'.$lang.''].'</option>';
}
echo "</select>";
if (isset($continent)){
echo $continent;}
echo '</p>';
echo '</fieldset>';
j'ai mis un champ hidden, comme vous me l'avez conseillé, mais c'est toujours pareil, la valeur $continent ne passe pas...
[php]
echo '<form method="get" action="'.$site.'liste.php" class="form01 type01" id="form01">';
echo '<div id="titreForm">'.$txt0140.'</div>';
echo '<div id="corpForm">';
echo '<fieldset id="coordonnees">';
echo '<legend>'.$txt0336.'</legend>';
echo '<p class="double">';
echo '<label for="f1-pays" class="oblig">'.$idem_txt0015;
echo '<span class="info"></span></label>';
echo '<select name="ad_pays" class="font">';
if (empty($data_dest['pays_'.$lang.'']))
{
echo '<option value="-1" selected="selected">'.$idem_txt0017.'</option>';
}
else
{
echo '<option value="-1">'.$idem_txt0017.'</option>';
}
// on se connecte à MySQL
include ('connect.php');
$sql_dest = sprintf("SELECT DISTINCT A.id_pay, A.pays_".$lang.", A.id_con, C.id_con, C.cont_".$lang."
FROM flatforswap_pays A
INNER JOIN flatforswap_continent C ON C.id_con = A.id_con
INNER JOIN flatforswap_ville B ON A.id_pay = B.id_pay
INNER JOIN flatforswap_adherent E ON E.id_vil = B.id_vil
WHERE E.valide = '2'
ORDER BY A.pays_".$lang." ASC");
$req_dest = mysql_query($sql_dest) or die('Erreur SQL !<br>'.$sql_dest.'<br>'.mysql_error());
while($data_dest = mysql_fetch_assoc($req_dest))
{
$selection = "";
$continent = "";
if ($ad_pays == $data_dest['pays_'.$lang.''])
{
$selection = 'selected="selected">';
$continent = '<input type="hidden" name="continent" value="'.$data_dest['cont_'.$lang.''].'">';
}
echo '<option value="'.$data_dest['pays_'.$lang.''].'" '.$selection.'>'.$data_dest['pays_'.$lang.''].'</option>';
}
echo "</select>";
if (isset($continent)){
echo $continent;}
echo '</p>';
echo '</fieldset>';
[/php]