par
coyaote » 03 sept. 2007, 10:29
Bonjour,
Voila j'ai rectifié le tir pour le formulaire que voici :
<legend>Please define an expression profile to match</legend>
<form name="formulaire" action='omg_save_filter.php' method="POST" >
<?php
$option1="option1";
$option2="option2";?>
<label for="<?php echo $option1;?>"></label>
<select onchange='afficheoption2(<?php echo $idparameters;?>,<?php echo $idproject;?>,<?php echo $option1;?>,<?php echo $option2;?>)' name='<?php echo $option1;?>' id='<?php echo $option1;?>' >
<OPTION VALUE=-1 selected> </OPTION>;
<OPTION value="cluster">Cluster</OPTION>
<OPTION value="BHR">BHR</OPTION>
<OPTION value="feature">Feature</OPTION>
<OPTION value="specie">Specie</OPTION>
<OPTION value="gene">Protein</OPTION>
</select>
<label for="<?php echo $option2;?>"></label>
<span name='<?php echo $option2;?>' id="<?php echo $option2;?>" >
<!-- Seconde liste deroulante-->
</span>
<br>
<div class="buttons">
<input type="hidden" name="idparameters" value="<?php echo $idparameters;?>"></input>
<input type="hidden" name="idproject" value="<?php echo $idproject;?>"></input>
<input type="hidden" name="history" value="<?php echo $historic;?>"></input>
<input type="hidden" name="user_defined_number_of_filters" value="<?php echo $user_defined_number_of_filters;?>"></input>
<input type="submit" name="submit" value="AND" class="btn_submit" ></input><br>
<input type="submit" name="submit" value="Submit" class="btn_submit" ></input>
</div>
</form>
Mais maintenant comment faire pour réitérer ce code plusieurs fois tout en récuperant les variables???
J'avais pensé au code ci-dessous, mais je n'arrive pas a recuperer les infos dans omg_save_filter.php:
<form name="formulaire" action='omg_save_filter.php' method="POST" >
<?php
for($i=0;$i<$user_defined_number_of_filters;$i++)
{
$option1="option1_".$i;
$option2="option2_".$i;?>
<label for="<?php echo $option1;?>"></label>
<select onchange='afficheoption2(<?php echo $idparameters;?>,<?php echo $idproject;?>,<?php echo $option1;?>,<?php echo $option2;?>)' name='<?php echo $option1;?>' id='<?php echo $option1;?>' >
<OPTION VALUE=-1 selected> </OPTION>;
<OPTION value="cluster">Cluster</OPTION>
<OPTION value="BHR">BHR</OPTION>
<OPTION value="feature">Feature</OPTION>
<OPTION value="specie">Specie</OPTION>
<OPTION value="gene">Protein</OPTION>
</select>
<label for="<?php echo $option2;?>"></label>
<span name='<?php echo $option2;?>' id="<?php echo $option2;?>" >
<!-- Seconde liste deroulante-->
</span>
<br>
<?php echo $option2;?>
<?php }?>
<div class="buttons">
<input type="hidden" name="idparameters" value="<?php echo $idparameters;?>"></input>
<input type="hidden" name="idproject" value="<?php echo $idproject;?>"></input>
<input type="hidden" name="history" value="<?php echo $historic;?>"></input>
<input type="hidden" name="user_defined_number_of_filters" value="<?php echo $user_defined_number_of_filters;?>"></input>
<input type="submit" name="submit" value="AND" class="btn_submit" ></input><br>
<input type="submit" name="submit" value="Submit" class="btn_submit" ></input>
</div>
</form>
omg_save_filter.php:
$idparameters="6";
$idproject="1";
$user_defined_number_of_filters="2";
for($i=0;$i<$user_defined_number_of_filters;$i++)
{
$option="option2_".$i;
echo "$i".$_POST[$option];
}
Pouvez vous m'aider?
Merci et bonne journée