passage de parametre

Eléphant du PHP | 406 Messages

15 juin 2005, 11:49

salut,


J ai un formulaire dans lequel j ai un tableau .Et dans ce tableau j ai pour chaque ligne un bouton option dans lequel je stocke un identifiant.
Et donc à chaque clique sur une ligne du tableau je selectionne le bouton identifiant correspondant.
Sur mon formulaire j ai des liste deroulante et lorsqu on choisi un element de la liste sa recharge la page et donc en theorie sa devrais aussi m afficher la valeur contenu dans le bouton option si je fais fait un echo de celui :
echo "tableau1 numserie ".$_POST['a'];
mais la je n ai rien qui s affiche.
????



Voila mon code

<?php 
    session_start(); 
?> 
<html> 

<head> 
<style> 
.red {background-color:white} 
.blue {background-color:blue} 
.black{background-color:black} 
.tab{cursor:crosshair } 
.option{checked:checked} 


</style> 

<SCRIPT LANGUAGE="JavaScript"> 

function reDimensionner() { 
var lg = screen.width; 
var ht = screen.height; 
window.resizeTo(lg,ht); 
window.moveTo(0,0); 
} 



var lastTr; 

var ids; 


function blok(objet, id_objet){ 
objet.className="option" 
if(lastTr)lastTr.className="red" 
objet.className="blue" 
lastTr=objet; 

document.getElementById(id_objet).checked = true; 

ids=document.getElementById(id_objet).value; 

alert(ids); 



} 
</script> 
</head> 
<? if(isset($_GET['poles'])){ 
    $_SESSION['poles']=@$_GET['poles']; 
    //echo "LA FAMILLE EST = A : ".$_SESSION['fams']; 
            } 
if(isset($_GET['poste'])){ 
    $_SESSION['poste']=@$_GET['poste']; 
     
            } 
echo "<h2>".$_SESSION['poles']."</h2>"; 
echo "<h2>".$_SESSION['poste']."</h2>"; 
if(isset($_GET['poles1'])){ 
    $_SESSION['poles1']=@$_GET['poles1']; 
    //echo "LA FAMILLE EST = A : ".$_SESSION['fams']; 
            } 
if(isset($_GET['poste1'])){ 
    $_SESSION['poste1']=@$_GET['poste1']; 
     
            } 
echo "<h2>".$_SESSION['poles1']."</h2>"; 
echo "<h2>".$_SESSION['poste1']."</h2>"; 
echo "tableau1 numserie ".$_POST['a']; 
?> 
<body onLoad="reDimensionner()"> 
<form name="affecter" method="post" action="<?php echo($_SERVER['PHP_SELF']); ?>"> 
<? include("connexion.inc.php"); ?> 
<br> 
<br> 
<div style="width:400px;  height:110px;overflow:auto;"> 
<? $sql="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele from objet,types_etat,etat_objet where etat_objet.numserie=objet.numserie and types_etat.numetat=etat_objet.numetat and etat='En commande' and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) order by etat_objet.numoperation"; 
$result=pg_query($sql); 
?> 
<table border="1"> 
<tr><th style="display:none">a</th> 
    <th>Etat</th> 
    <th>Famille</th> 
    <th>N° serie</th> 
    <th>Marque</th> 
    <th>Modele</th> 
</tr>     
<? 
$i=0; 
while($list=pg_fetch_array($result)){ 
?> 
<tr class="white" onClick="blok(this, 'radio<? echo  $i ; ?>')"><td style="display:none"><input type="radio" name="a" id="radio<? echo  $i ; ?>" value="<? echo $list['numserie'];?>"></td> 
    <td><? echo $list['etat']; ?></td> 
    <td><? echo $list['type_objet']; ?></td> 
    <td><? echo $list['numserie']; ?></td> 
    <td><? echo $list['marque']; ?></td> 
    <td><? echo $list['modele']; ?></td> 
</tr> 
<? 
$i=$i+1; 
} 
?> 
</table> 
</div> 
<br> 
<br> 
<table> 
<tr><td>Poles</td><td> 
<? 
////////////////affichage poles//////////////////// 


// on crée la requête SQL 
$sql = "select  numpole,code_pole from poles order by code_pole"; 
$res=pg_query($sql); 
?> 

<select name="pol"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poles=' + this.value"> 

<option>--Poles--</option> 

<? 
while($list=pg_fetch_array($res)){ 
?> 

<option value="<?php echo ($list['code_pole']);?>"  <? if(@$_SESSION['poles'] == $list['code_pole']){echo(" selected=\"selected\"");}?>><?php echo ($list['code_pole']); ?></option> 

<?php 
    } 
?> 
    </select> 



        </td> 


    <td>N°Poste</td><td> 



<? 
////////////////affichage poste//////////////////// 


// on crée la requête SQL 
if(isset($_GET['poles'])){ 
$sql = "select numposte,nom_personnel,prenom,pole from poles,poste,personnel where personnel.numpersonnel=poste.numpersonnel and poles.numpole=poste.numpole and code_pole='".$_GET['poles']."' order by nom_personnel"; 
}else{ 
$sql = "select numposte,nom_personnel,prenom,pole from poles,poste,personnel where personnel.numpersonnel=poste.numpersonnel and poles.numpole=poste.numpole and code_pole='".@$_SESSION['poles']."' order by nom_personnel"; 
} 
//echo "<b>".$sql."</b>"; 
$res=pg_query($sql); 
?> 

<select name="posts"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poste=' + this.value"> 

<option>--Poste--</option> 

<? 
while($list=pg_fetch_array($res)){ 
?> 

<option value="<?php echo ($list['numposte']);?>"  <? if(@$_SESSION['poste'] == $list['numposte']){echo(" selected=\"selected\"");}?>><?php echo ($list['nom_personnel']); ?></option> 

<?php 
    } 
?> 
    </select> 




        </td> 

</tr> 

</table> 

<br> 
<div style="width:400px;  height:110px;overflow:auto;"> 
<? 
//Affichage des objets detenu par une personne en fonction du choix du poste 
if(isset($_GET['poste'])){ 
$sql1="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele from objet,types_etat,etat_objet,poste where etat_objet.numserie=objet.numserie and types_etat.numetat=etat_objet.numetat and poste.numposte=objet.numposte and etat='En poste' and objet.numposte='".$_GET['poste']."' and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) order by etat_objet.numoperation"; 
}else{ 
$sql1="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele from objet,types_etat,etat_objet,poste where etat_objet.numserie=objet.numserie and types_etat.numetat=etat_objet.numetat and poste.numposte=objet.numposte and etat='En poste' and objet.numposte='".$_SESSION['poste']."' and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) order by etat_objet.numoperation"; 
} 
$resu=pg_query($sql1); 
?> 
<table border="1"> 
<tr><th style="display:none">b</th> 
    <th>Famille</th> 
    <th>N°serie</th> 
    <th>Marque</th> 
    <th>Modele</th> 
    <th>Etat</th> 
</tr>     
<? 
$i=0; 
while($list1=pg_fetch_array($resu)){ 
?> 
<tr class="white" onClick="blok(this, 'radio2<? echo  $i ; ?>')"><td style="display:none"><input type="radio" name="b" id="radio2<? echo  $i ; ?>" value="<? echo $list1['numserie'];?>"></td> 
    <td><? echo $list1['type_objet']; ?></td> 
    <td><? echo $list1['numserie']; ?></td> 
    <td><? echo $list1['marque']; ?></td> 
    <td><? echo $list1['modele']; ?></td> 
    <td><? echo $list1['etat']; ?></td> 
</tr> 
<? 
$i=$i+1; 
} 
?> 
</table> 
</div> 
<br> 


<br> 
<br> 
<table> 
<tr><td>Poles</td><td> 
<? 
////////////////affichage poles//////////////////// 


// on crée la requête SQL 
$sql = "select  numpole,code_pole from poles order by code_pole"; 
$res=pg_query($sql); 
?> 

<select name="pol1"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poles1=' + this.value"> 

<option>--Poles--</option> 

<? 
while($list=pg_fetch_array($res)){ 
?> 

<option value="<?php echo ($list['code_pole']);?>"  <? if(@$_SESSION['poles1'] == $list['code_pole']){echo(" selected=\"selected\"");}?>><?php echo ($list['code_pole']); ?></option> 

<?php 
    } 
?> 
    </select> 



        </td> 


    <td>N°Poste</td><td> 



<? 
////////////////affichage poste//////////////////// 


// on crée la requête SQL 
if(isset($_GET['poles1'])){ 
$sql = "select numposte,nom_personnel,prenom,pole from poles,poste,personnel where personnel.numpersonnel=poste.numpersonnel and poles.numpole=poste.numpole and code_pole='".$_GET['poles1']."' order by nom_personnel"; 
}else{ 
$sql = "select numposte,nom_personnel,prenom,pole from poles,poste,personnel where personnel.numpersonnel=poste.numpersonnel and poles.numpole=poste.numpole and code_pole='".@$_SESSION['poles1']."' order by nom_personnel"; 
} 
//echo "<b>".$sql."</b>"; 
$res=pg_query($sql); 
?> 

<select name="posts1"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poste1=' + this.value"> 

<option>--Poste--</option> 

<? 
while($list=pg_fetch_array($res)){ 
?> 

<option value="<?php echo ($list['numposte']);?>"  <? if(@$_SESSION['poste1'] == $list['numposte']){echo(" selected=\"selected\"");}?>><?php echo ($list['nom_personnel']); ?></option> 

<?php 
    } 
?> 
    </select> 




        </td> 

</tr> 

</table> 

<br> 
<div style="width:400px;  height:110px;overflow:auto;"> 
<? 
//Affichage des objets detenu par une personne en fonction du choix du poste 
if(isset($_GET['poste1'])){ 
$sql2="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele from objet,types_etat,etat_objet,poste where etat_objet.numserie=objet.numserie and types_etat.numetat=etat_objet.numetat and poste.numposte=objet.numposte and etat='En poste' and objet.numposte='".$_GET['poste1']."' and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) order by etat_objet.numoperation"; 
}else{ 
$sql2="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele from objet,types_etat,etat_objet,poste where etat_objet.numserie=objet.numserie and types_etat.numetat=etat_objet.numetat and poste.numposte=objet.numposte and etat='En poste' and objet.numposte='".@$_SESSION['poste1']."' and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) order by etat_objet.numoperation"; 
} 
$resu2=pg_query($sql2); 
?> 
<table border="1"> 
<tr><th style="display:none">b</th> 
    <th>Famille</th> 
    <th>N°serie</th> 
    <th>Marque</th> 
    <th>Modele</th> 
    <th>Etat</th> 
</tr>     
<? 
$i=0; 
while($list2=pg_fetch_array($resu2)){ 
?> 
<tr class="white" onClick="blok(this, 'radio3<? echo  $i ; ?>')"><td style="display:none"><input type="radio" name="c" id="radio3<? echo  $i ; ?>" value="<? echo $list2['numserie'];?>"></td> 
    <td><? echo $list2['type_objet']; ?></td> 
    <td><? echo $list2['numserie']; ?></td> 
    <td><? echo $list2['marque']; ?></td> 
    <td><? echo $list2['modele']; ?></td> 
    <td><? echo $list2['etat']; ?></td> 
</tr> 
<? 
$i=$i+1; 
} 
?> 
</table> 
</div> 
<br> 
</form> 
</body> 
</html>  


Merci

Eléphant du PHP | 406 Messages

15 juin 2005, 11:50

pourtant j ai fait un bouton pour tester et avec le bouton cela m affiche bien la valeur

Mammouth du PHP | 19672 Messages

15 juin 2005, 11:57

C'est normal, si tu regardes ta source HTML générée, tu vas probablement trouver tes valeurs: ta as mis l'affichage AVANT la balise <body>
Ton code remis en ordre:
<?php
session_start();
?>
<html>
<head>
<style>
.red {background-color:white}
.blue {background-color:blue}
.black{background-color:black}
.tab{cursor:crosshair }
.option{checked:checked}
</style>
<SCRIPT LANGUAGE="JavaScript">
function reDimensionner()
{
    var lg = screen.width;
    var ht = screen.height;
    window.resizeTo(lg,ht);
    window.moveTo(0,0);
}
var lastTr;
var ids;
function blok(objet, id_objet)
{
    objet.className="option";
    if(lastTr)
    {
        lastTr.className="red";
    }
    objet.className="blue";
    lastTr=objet;

    document.getElementById(id_objet).checked = true;

    ids=document.getElementById(id_objet).value;

    alert(ids);
}
</script>
</head>
<body onLoad="reDimensionner()">
<?
if(isset($_GET['poles']))
{
    $_SESSION['poles'] = $_GET['poles'];
    //echo "LA FAMILLE EST = A : ".$_SESSION['fams'];
}
if(isset($_GET['poste']))
{
    $_SESSION['poste'] = $_GET['poste'];

}
echo "<h2>".$_SESSION['poles']."</h2>";
echo "<h2>".$_SESSION['poste']."</h2>";
if(isset($_GET['poles1']))
{
    $_SESSION['poles1']=$_GET['poles1'];
    //echo "LA FAMILLE EST = A : ".$_SESSION['fams'];
}
if(isset($_GET['poste1']))
{
    $_SESSION['poste1'] = $_GET['poste1'];

}
echo "<h2>".$_SESSION['poles1']."</h2>";
echo "<h2>".$_SESSION['poste1']."</h2>";
echo "tableau1 numserie ".$_POST['a'];
?>
<form name="affecter" method="post" action="<?php echo($_SERVER['PHP_SELF']); ?>">
<?
include("connexion.inc.php");
?>
<br>
<br>
<div style="width:400px;  height:110px;overflow:auto;">
<?
$sql="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele ".
"from objet,types_etat,etat_objet ".
"where etat_objet.numserie=objet.numserie ".
"and types_etat.numetat=etat_objet.numetat ".
"and etat='En commande' ".
"and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) ".
"order by etat_objet.numoperation";
$result=pg_query($sql);
?>
<table border="1">
<tr>
    <th style="display:none">a</th>
    <th>Etat</th>
    <th>Famille</th>
    <th>N° serie</th>
    <th>Marque</th>
    <th>Modele</th>
</tr>    
<?
$i=0;
while($list=pg_fetch_array($result))
{
    ?>
<tr class="white" onClick="blok(this, 'radio<? echo  $i ; ?>')">
    <td style="display:none"><input type="radio" name="a" id="radio<? echo  $i ; ?>" value="<? echo $list['numserie'];?>"></td>
    <td><? echo $list['etat']; ?></td>
    <td><? echo $list['type_objet']; ?></td>
    <td><? echo $list['numserie']; ?></td>
    <td><? echo $list['marque']; ?></td>
    <td><? echo $list['modele']; ?></td>
</tr>
    <?
    $i++;
}
?>
</table>
</div>
<br>
<br>
<table>
  <tr>
    <td>Poles</td>
    <td>
<?
////////////////affichage poles////////////////////

// on crée la requête SQL
$sql = "select  numpole,code_pole from poles order by code_pole";
$res=pg_query($sql);
?>
        <select name="pol"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poles=' + this.value">
          <option>--Poles--</option>
<?
while($list=pg_fetch_array($res))
{
?>
          <option value="<?php echo ($list['code_pole']);?>"  <? if($_SESSION['poles'] == $list['code_pole']){echo(" selected=\"selected\"");}?>><?php echo ($list['code_pole']); ?></option>
<?php
}
?>
        </select>
      </td>
    <td>N°Poste</td><td>
<?
////////////////affichage poste////////////////////

// on crée la requête SQL
if(isset($_GET['poles']))
{
    $sql = "select numposte,nom_personnel,prenom,pole ".
    "from poles,poste,personnel ".
    "where personnel.numpersonnel=poste.numpersonnel ".
    "and poles.numpole=poste.numpole ".
    "and code_pole='".$_GET['poles']."' ".
    "order by nom_personnel";
}
else
{
    $sql = "select numposte,nom_personnel,prenom,pole ".
    "from poles,poste,personnel ".
    "where personnel.numpersonnel=poste.numpersonnel ".
    "and poles.numpole=poste.numpole ".
    "and code_pole='".$_SESSION['poles']."' ".
    "order by nom_personnel";
}
//echo "<b>".$sql."</b>";
$res=pg_query($sql);
?>
      <select name="posts"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poste=' + this.value">
        <option>--Poste--</option>
<?
while($list=pg_fetch_array($res))
{
?>
        <option value="<?php echo ($list['numposte']);?>"  <? if($_SESSION['poste'] == $list['numposte']){echo(" selected=\"selected\"");}?>><?php echo ($list['nom_personnel']); ?></option>
<?php
}
?>
      </select>
    </td>
  </tr>
</table>
<br>
<div style="width:400px;  height:110px;overflow:auto;">
<?
//Affichage des objets detenu par une personne en fonction du choix du poste
if(isset($_GET['poste']))
{
    $sql1="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele ".
    "from objet,types_etat,etat_objet,poste ".
    "where etat_objet.numserie=objet.numserie ".
    "and types_etat.numetat=etat_objet.numetat ".
    "and poste.numposte=objet.numposte ".
    "and etat='En poste' ".
    "and objet.numposte='".$_GET['poste']."' ".
    "and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) ".
    "order by etat_objet.numoperation";
}
else
{
    $sql1="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele ".
    "from objet,types_etat,etat_objet,poste ".
    "where etat_objet.numserie=objet.numserie ".
    "and types_etat.numetat=etat_objet.numetat ".
    "and poste.numposte=objet.numposte ".
    "and etat='En poste' ".
    "and objet.numposte='".$_SESSION['poste']."' ".
    "and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) ".
    "order by etat_objet.numoperation";
}
$resu=pg_query($sql1);
?>
<table border="1">
<tr><th style="display:none">b</th>
    <th>Famille</th>
    <th>N°serie</th>
    <th>Marque</th>
    <th>Modele</th>
    <th>Etat</th>
</tr>    
<?
$i=0;
while($list1=pg_fetch_array($resu))
{
    ?>
<tr class="white" onClick="blok(this, 'radio2<? echo  $i ; ?>')"><td style="display:none"><input type="radio" name="b" id="radio2<? echo  $i ; ?>" value="<? echo $list1['numserie'];?>"></td>
    <td><? echo $list1['type_objet']; ?></td>
    <td><? echo $list1['numserie']; ?></td>
    <td><? echo $list1['marque']; ?></td>
    <td><? echo $list1['modele']; ?></td>
    <td><? echo $list1['etat']; ?></td>
</tr>
    <?
    $i++;
}
?>
</table>
</div>
<br>
<br>
<br>
<table>
  <tr>
    <td>Poles</td>
    <td>
<?
////////////////affichage poles////////////////////

// on crée la requête SQL
$sql = "select  numpole,code_pole from poles order by code_pole";
$res=pg_query($sql);
?>
      <select name="pol1"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poles1=' + this.value">
        <option>--Poles--</option>
<?
while($list=pg_fetch_array($res))
{
?>
        <option value="<?php echo ($list['code_pole']);?>"  <? if($_SESSION['poles1'] == $list['code_pole']){echo(" selected=\"selected\"");}?>><?php echo ($list['code_pole']); ?></option>
<?php
}
?>
      </select>
    </td>
    <td>N°Poste</td><td>
<?
////////////////affichage poste////////////////////

// on crée la requête SQL
if(isset($_GET['poles1']))
{
    $sql = "select numposte,nom_personnel,prenom,pole ".
    "from poles,poste,personnel ".
    "where personnel.numpersonnel=poste.numpersonnel ".
    "and poles.numpole=poste.numpole ".
    "and code_pole='".$_GET['poles1']."' ".
    "order by nom_personnel";
}
else
{
    $sql = "select numposte,nom_personnel,prenom,pole ".
    "from poles,poste,personnel ".
    "where personnel.numpersonnel=poste.numpersonnel ".
    "and poles.numpole=poste.numpole ".
    "and code_pole='".$_SESSION['poles1']."' ".
    "order by nom_personnel";
}
//echo "<b>".$sql."</b>";
$res=pg_query($sql);
?>
      <select name="posts1"  onChange="location.href='<?php echo  $_SERVER['PHP_SELF'] ; ?>?poste1=' + this.value">
        <option>--Poste--</option>
<?
while($list=pg_fetch_array($res))
{
?>
        <option value="<?php echo ($list['numposte']);?>"  <? if($_SESSION['poste1'] == $list['numposte']){echo(" selected=\"selected\"");}?>><?php echo ($list['nom_personnel']); ?></option>
<?php
}
?>
      </select>
    </td>
  </tr>
</table>
<br>
<div style="width:400px;  height:110px;overflow:auto;">
<?
//Affichage des objets detenu par une personne en fonction du choix du poste
if(isset($_GET['poste1']))
{
    $sql2="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele ".
    "from objet,types_etat,etat_objet,poste ".
    "where etat_objet.numserie=objet.numserie ".
    "and types_etat.numetat=etat_objet.numetat ".
    "and poste.numposte=objet.numposte ".
    "and etat='En poste' ".
    "and objet.numposte='".$_GET['poste1']."' ".
    "and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) ".
    "order by etat_objet.numoperation";
}
else
{
    $sql2="select distinct(objet.numserie),etat_objet.numoperation,etat,type_objet,marque,modele ".
    "from objet,types_etat,etat_objet,poste ".
    "where etat_objet.numserie=objet.numserie ".
    "and types_etat.numetat=etat_objet.numetat ".
    "and poste.numposte=objet.numposte ".
    "and etat='En poste' ".
    "and objet.numposte='".$_SESSION['poste1']."' ".
    "and etat_objet.numoperation=(select max(numoperation) from etat_objet where etat_objet.numserie=objet.numserie) ".
    "order by etat_objet.numoperation";
}
$resu2=pg_query($sql2);
?>
<table border="1">
  <tr>
    <th style="display:none">b</th>
    <th>Famille</th>
    <th>N°serie</th>
    <th>Marque</th>
    <th>Modele</th>
    <th>Etat</th>
  </tr>    
<?
$i=0;
while($list2=pg_fetch_array($resu2))
{
    ?>
  <tr class="white" onClick="blok(this, 'radio3<? echo  $i ; ?>')">
    <td style="display:none"><input type="radio" name="c" id="radio3<? echo  $i ; ?>" value="<? echo $list2['numserie'];?>"></td>
    <td><? echo $list2['type_objet']; ?></td>
    <td><? echo $list2['numserie']; ?></td>
    <td><? echo $list2['marque']; ?></td>
    <td><? echo $list2['modele']; ?></td>
    <td><? echo $list2['etat']; ?></td>
</tr>
    <?
    $i++;
}
?>
</table>
</div>
<br>
</form>
</body>
</html>
C'est pas plus facile à lire comme ça ??
Codez en pensant que celui qui maintiendra votre code est un psychopathe qui connait votre adresse :axe:

Eléphant du PHP | 406 Messages

15 juin 2005, 13:11

J ai modifier mais sa ne viens pas de la
parceque j avais fait le teste en ajoutant un bouton et au click sur le bouton la valeur s affichais

Eléphant du PHP | 406 Messages

15 juin 2005, 13:17

J ai modifier ma fonction javascript

Code : Tout sélectionner

function blok(objet, id_objet){ objet.className="option" if(lastTr)lastTr.className="red" objet.className="blue" lastTr=objet; document.getElementById(id_objet).checked = true; ids=document.getElementById(id_objet).value; alert(ids); location.href='<?php echo $_SERVER['PHP_SELF'] ; ?>?num=' + ids; }
Ce qui fait que je recupere le numero dans l url
et je l affiche avec un $_GET

Mammouth du PHP | 19672 Messages

15 juin 2005, 13:17

Quand tu fais une sélection, qu'est-ce que tu obtiens ou non par rapoprt à ce que tu attends ?
Codez en pensant que celui qui maintiendra votre code est un psychopathe qui connait votre adresse :axe:

Eléphant du PHP | 406 Messages

15 juin 2005, 13:58

il ne m affichai rien

Mammouth du PHP | 19672 Messages

15 juin 2005, 14:34

donny, réveil :!: Il faut tout te mâcher ou quoi ??? nous répondre simplement "ça ne marche pas" ou "Ça n'affiche rien", tu te figures que ça nous permet de t'aider ? Comment veux-tu qu'on sache ce qui se passe sur ta machine ?

Procédure de débuggage: faire afficher les variables, s'il n'y a rien, remonter plus haut dans le code et voir où sont initialisées ces variables: vérifier si on aurait pas oublié un détail dans l'initialisation. Si la valeur vient d'une requête, faire afficher le résultat de la requête, ou faire afficher carrément la requête et l'exécuter dans ton utilitaire de gestion de base directement et voir le retour, données ou message d'erreur.

C'est quand même pas si complexe que ça. Apprends donc à chercher l'origine d'une erreur. Essaye d'isoler la source du problème au lieu de balancer 200 lignes de code en disant, "Ça marche pas au secours" :!:
Codez en pensant que celui qui maintiendra votre code est un psychopathe qui connait votre adresse :axe:

Eléphant du PHP | 406 Messages

15 juin 2005, 14:55

j avais pas vu
j ai oublier de le mettre que j avais trouver une solution
merci