Urgent extraction de données de pages en php

bonjour
j'ai implementé deux pages en php dont je dois extraire les données d'une page vers l'autre et j'utilise un bouton de type image mais j'ai pas pu reussi à faire l'extraction
svp j'ai besoin de vos aide c'est urgent:''((((
le code de la page principale est:

<form id="form1" name="form1" method="post" action="">

<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCE6FF" >
<tr>
<td height="53" colspan="4" ><div align="center" class="Style3">Bon de Remplissage de Gasoil par Carte </div></td>
</tr>
</table>

<p></p>
<div align="center">
<fieldset style="width:600px;" >
<table align="center">
<tr>
<?php
$id=$_GET['id'];
include("connexion.php");
$req=mysql_query("select * from carte_gasoil where id='".$id."'");
$row=mysql_fetch_object($req);
?>
<td height="46"> <span class="Style14">N° Bon</span></td>
<td> <input type="text" name="num_bon_carte" id="num_bon_carte" value="<?php echo $_GET['num_bon_carte'];?>" /></td>

<td nowrap="nowrap"><p><span class="Style14">Carte</span></p></td>

<td><input type="text" name="num_carte" id="num_carte" value="<?php echo $_GET['num_carte'];?>"/></td>
<td><a href="liste_carte_gasoil.php?" class="Style7"><input type=image value=submit onclick="this.form.action='liste_carte_gasoil.php';this.form.submit ()" src="images/download.bmp" alt="Afficher" width="28" height="29" /></a></td>
</tr>
</table ></fieldset></div>
<p></p>
<div align="center">
<fieldset style="width:600px;" >
<table align="center" height="200">

<tr >
<td><p><span class="Style7">Matricule</span></p></td><td><input type="text" name="matricule_carte" id="matricule_carte" value="<?php echo $_GET['matricule_carte'];?>"/></td>
<td> </td>
<td><p><span class="Style7">Quantité</span></p></td><td><input type="text" name="quantite"size="20" value="<?php echo $_GET['matricule_carte'];?>"/></td>
</tr>
<tr>

<td nowrap="nowrap"><p><span class="Style7">Nom & Pré Chauffeur</span></p></td>
<?php
$id=$_GET['id'];
include("connexion.php");
$req=mysql_query("select * from chauffeur where id='".$id."'");
$row=mysql_fetch_object($req);
?>
<td><input type="text" name="nom_prenom_chauffeur"size="20" value="<?php echo $_GET['nom_prenom_chauffeur'];?>"/></td>
<td><a href="liste_chauffeur.php?" class="Style7"><input type=image value=submit onclick="this.form.action='liste_chauffeur.php';this.form.submit ()" src="images/download.bmp" alt="Afficher" width="28" height="29" /></a></td>
<td><p><span class="Style7">PU</span></p></td><td><input type="text" name="pu" size="20" value="<?php echo $_GET['pu'];?>"/></td>
</tr>
<tr >
<td><p><span class="Style7">Pays</span></p></td><td><input type="text" name="pays" size="20"value="<?php echo $_GET['pays'];?>"/></td>
<td> </td>
<td><p><span class="Style7">HT</span></p></td> <td><input type="text" name="ht"size="20" value="<?php echo $_GET['ht'];?>"/></td>
</tr>
<tr>
<td><p><span class="Style7">Lieu</span></p></td><td><input type="text" name="lieu"size="20" value="<?php echo $_GET['lieu'];?>"/></td>
<td> </td>
<td><p><span class="Style7">TVA</span></p></td><td><input type="text" name="tva" size="20" value="<?php echo $_GET['tva'];?>"/></td>
</tr>
<tr>
<td><p><span class="Style7">KM</span></p></td><td><input type="text" name="km" size="20" value="<?php echo $_GET['km'];?>"/></td>
<td> </td>
<td><p><span class="Style7">TTC</span></p></td><td><input type="text" name="ttc" size="20" value="<?php echo $_GET['ttc'];?>"/></td>
</tr>
<tr>
<td><p><span class="Style7">Produit</span></p></td><td><input type="text" name="produit" size="20" value="<?php echo $_GET['produit'];?>"/></td>
<td> </td>
<td> </td>
<td> </td>
</tr>

</table>
</fieldset>
<table align="center">

<tr>
<td> <input type="submit" name="Submit2" value="Quitter" onclick="page1.php" /></td>
<td nowrap="nowrap"><div align="right" class="Style7">
<input type="submit" name="Submit" value="Ajouter" />
</div></td>
<td width="67" nowrap="nowrap"><input name="Submit2" type="reset" onclick="window.history.go(-1)" value="Retour" /></td>

</p>
</td></tr></table>
</form>

Le code de la 2eme page ou je vais extraire les données est

<form id="form1" name="form1" method="post" action="">
<p align="center"> <table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCE6FF">
<tr rowspan="4" bgcolor="#CCE6E6">
<td height="50" colspan="4" > <div align="center" class="Style1">
<div align="center" class="Style3">Gestion des Cartes Gasoil</div></td>
</tr>
<tr rowspan="3" ><td colspan="4" nowrap="nowrap" ><div align="center"><span class="Style4"></span></div></td>
</tr>
<tr >
<td ><span class="Style4"></span></td>
<td ><div align="right"><span class="Style4"><strong>Carte: </strong></span></div></td>
<td><input name="num_carte_rech" type="text" id="num_carte_rech" size="16" /> </div></td>
<td> <input name="Submit" type="submit" class="Style1" value="Rechercher" /></td>
</tr>
</table>
</p>
<table width="1000" align="center">
<tr bgcolor="#CCE6E6">
<td width="39" nowrap="nowrap" ><span class="Style4"><strong>N°</strong></span></td>
<td width="70" nowrap="nowrap"><span class="Style4"><strong>N° Carte</strong></span></td>
<td width="141" nowrap="nowrap" ><span class="Style4"><strong>Matricule</strong></span></td>
<td width="55"><span class="Style4"><strong>Choisir</strong></span></td>
</tr>
<?php include("connexion.php");

$i=0;
import_request_variables(gp);
$req=mysql_query("select * from carte_gasoil where num_carte like'".$num_carte_rech."%' ORDER BY 'num_carte' DESC ")or die (mysql_error());

while($row=mysql_fetch_object($req))
{ $i++;
if(($i % 2)==1)
{$col='#CCE6FF';
} else $col='#CCE6E6';
?>
<tr bgcolor=<?php echo $col; ?>>
<td><span class="Style14"><?php echo $i;?></span></td>
<td nowrap="nowrap"><span class="Style14"><?php echo $row->num_carte; ?></span></td>
<td nowrap="nowrap"><span class="Style14"><?php echo $row->matricule_carte; ?></span></td>
<td bgcolor="<?php echo $col; ?>"><a href="bon_remplir_gasoil_par_carte.php?matricule_carte=<?php echo $_POST['matricule_carte'];?>&num_bon_carte=<?php echo $_POST['num_bon_carte'];?>&num_carte=<?php echo $_POST['num_carte'];?>&quantite=<?php echo $_POST['quantite'];?>&nom_prenom_chauffeur=<?php echo $_POST['nom_prenom_chauffeur'];?>&pu=<?php echo $_POST['pu'];?>&pays=<?php echo $_POST['pays'];?>&ht=<?php echo $_POST['ht'];?>&lieu=<?php echo $_POST['lieu'];?>&tva=<?php echo $_POST['tva'];?>&km=<?php echo $_POST['km'];?>&ttc=<?php echo $_POST['ttc'];?>&produit=<?php echo $_POST['produit'];?> "><img src="images/upload.bmp" alt="choisir" width="33" height="34" /></a></td>
</tr>

<?php }?>

</table>
<p> </p>
<p><a href="page1.php"><img src="images/precedent.jpg" alt="Quitter" width="70" height="65" border="0" /></a></p>
<p> </p>
</form>

1 réponse

  • Votes
  • Date
  • Date décroissante
  1. pr la premiére page, tu met soit
    <form id="form1" name="form1" method="post" action="nom de ta seconde page.extension"> et ça devrait normalement mieux fonctionner...