Bonjour a tous
J'ai un probleme pour recuperer une variable dans une popup
J'ai une 1ere popup avec un formulaire ou se trouve une liste deroulante
Pour remplir cette liste je fait appel a une fonction.
//////////
affichelistetech2($codetechnicien,"codetechnicien",1);
///////////
code de la fonction :
/////////////
function affichelistetech2($codetechnicien,$nom,$allowempty) {
$query="SELECT codetechnicien, nom FROM techniciens where nom!='CLIENT' ORDER by nom";
$req=mysql_query($query);
echo"<form name=\"validation\" ACTION=\"validation.php\" method=\"post\">";
echo"<select name='$nom' onChange=\"window.open('popup.php?page=validation&codetechnicien=$codetechnicien&referrant=$PAGEURLENC','Confirmation','width=500,height=305')\">";
if($allowempty!=0)
echo "<option value=\"\"></option>";
while($line = mysql_fetch_array($req)) {
$tmpcode=$line["codetechnicien"];
$tmpnom=$line["nom"];
echo "<option";
if($codetechnicien==$tmpcode) {
echo " selected";
}
printf(" value =\"%d\">%s</option>\n",$tmpcode,$tmpnom);
}
echo "</select>\n";
echo "</form>";
}
////////////////
Ma 2eme popup s'ouvre bizen lorsque je change de valeur dans la liste deroulante mais le probleme est ke je dois recuperer la variable $codetechnicien dans le fichier validation.php
Donc je fais :
//////////////////////
<?
$query = "SELECT nom FROM techniciens where codetechnicien=$codetechnicien LIMIT 1";
$req = mysql_query($query);
$line = mysql_fetch_array($req);
$nom = $line ["nom"];
echo "Technicien : <b>$nom</b><br>\n";
?>
////////////////////
Mais la je recupere la 1ere valeur de ma liste
Et j'ai beau changer ma valeur dans la liste je recupere toujours celle dorigine
Si quelqun a une solution je suis preneur...
Merci
Atomik29
