Transmission d'un variable en php

Fermé
abdeslam1999 Messages postés 29 Date d'inscription jeudi 21 mai 2009 Statut Membre Dernière intervention 16 avril 2018 - 13 juin 2009 à 21:47
giheller Messages postés 1875 Date d'inscription dimanche 14 juin 2009 Statut Membre Dernière intervention 3 février 2024 - 14 juin 2009 à 18:11
Bonjour,
J'ai crée deux pages web en php ,dans la première page je saisie un n° dans un champ de text.
je voudrais recupérer ce n° dans la deuxième page dans un champ de text aprés d'un clique sur un submit.

voilà mon bout de code :

page1:Consultation_client.php
<?php
echo'<a href="/Gestion_Commerciale/articles/article_consulte.php?action=consultation_client&v_ref_consult
<input type="text" name="v_ref_consult" style="width:197px"/> </a>'
?>

page2:article_consulte.php

<td width="217" bgcolor="#99FFFF" align="right"><label>
<input type="text" name="refe_consult" <?php echo'value="'.$_GET['v_ref_consult'].'"'?> /></label></td>


Cordialement

2 réponses

giheller Messages postés 1875 Date d'inscription dimanche 14 juin 2009 Statut Membre Dernière intervention 3 février 2024 142
14 juin 2009 à 17:32
Bonjour

essayez tout simplment :
page2:article_consulte.php

<td width="217" bgcolor="#99FFFF" align="right"><label>
<?php echo $_GET['v_ref_consult']?> /></label></td>
0
Alain_42 Messages postés 5361 Date d'inscription dimanche 3 février 2008 Statut Membre Dernière intervention 13 février 2017 894
14 juin 2009 à 18:06
essaye plutot avec cette mlethode et un input dans un formulaire:

page1:Consultation_client.php
<form name="form1" method="post" action="article_consulte.php">

<input type="text" name="v_ref_consult" value=""style="width:197px"/> <br />
<input type="submit" name="consulter" value="Consulter">
</form>

page2:article_consulte.php
<?php

if(isset($_POST['consulter"'])){ //le bouton Consulter de type submit a été cliqué 
	//on recupere la valeur postée
	$v_ref_consult=$_POST['v_ref_consult'];
}
?>
<td width="217" bgcolor="#99FFFF" align="right"><label>
<input type="text" name="refe_consult" value="<?php echo $v_ref_consult; ?>" /></label></td> 
0
giheller Messages postés 1875 Date d'inscription dimanche 14 juin 2009 Statut Membre Dernière intervention 3 février 2024 142
14 juin 2009 à 18:11
bonjour,
oui c'est mieux, j'avais mal étudié le formulaire
0