bonjour a tous
j'ai un probleme de transfert de données
j'ai fait un moteur de recherche sur un base sql
il m'affiche certains que lui indique puis je veut faire une fonction qui m'affiche tout dans un formulaire
voici mes codes pour aider
le moteur de recherche
<html>
<head>
<title>Rechercher</title>
<link href="css/style2.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action='scripts/recherche.php' target="rechbas" method='post' name="rechercher" enctype="multipart/form-data">
<table width=50% align=center>
<tr>
<td align=rigth><input class='text' type="text" name="recherche" size=50 maxlength=50></td>
<td align=left><input class="bouton" type="submit" name="Rechercher" value="Rechercher"></td>
</tr>
</table>
<table width=25% align=center>
<tr>
<td><input type="radio" name="choix" value="nom_ind" checked>nom</td>
<td><input type="radio" name="choix" value="nom_org">organisme</td>
</tr>
</table>
</form>
</body>
</html>
l'affichage des resultat
<?php
$connect=mysql_connect("127.0.0.1", "root", "") or die ("Echec de la connexion au serveur !");
$select=mysql_select_db("base");
$query="select * from individu";
$result=mysql_query($query);
$totenreg=mysql_num_rows($result);
echo "<form action='http://127.0.0.1/muse/recherche/scripts/fiche.php' method='post' name='fiche' enctype='multipart/form-data'>";
if ($totenreg==0) // si il n'y a rien dans le champs de recherche
echo "<td colspan=9 align=center bgcolor='#000000'><h2>IL N'Y A PAS DE CLIENTS A RECHERCHER</td>";
else if (!(empty($_POST["recherche"]))) // sinon il y a recherche
{
echo "<table width=100% border=1 align=center>";
echo "<td colspan=9><h2>RECHERCHER INDIVIDU(S)</td>";
echo "</tr>";
echo "<tr align=center bgcolor=#87CEEB>";
echo "<td><h4 class='h41'>NOM</td>";
echo "<td><h4 class='h41'>PRENOM</td>";
echo "<td><h4 class='h41'></td>";
$i=0;
while ($row=mysql_fetch_array($result))
{
if (stristr($row[$_POST["choix"]], $_POST["recherche"]))
{
if ($i==0)
{
echo "<tr bgcolor=#D3D3D3>";
$i++;
}
else
{
echo "<tr bgcolor=#FFFFFF>"; //affichage des informations de la base selon la recherche demander
$i--;
}
echo "<td><h5>".$row["nom_ind"]."</td>";
echo "<td><h5>".$row["prenom_ind"]."</td>";
echo "<td><h5>".$row["id_ind"]."</td>";
$id=$row["id_ind"];
echo "<td align=center><input class='bouton' type='submit' name='Suivant' value='fiche complete'></td>";
echo "</tr>";
}
}
echo "</table>";
}
else
echo "<h4>Veuillez remplir le champ recherche !";
?>
puis la fiche complete
echo"$id";
$connect=mysql_connect("127.0.0.1", "root", "") or die ("Echec de la connexion au serveur !");
$select=mysql_select_db("base");
$query="select * from individu where id_ind='$id'";
$result=mysql_query($query);
$totenreg=mysql_num_rows($result); //retourne le nombre de lignes du résultat
echo "<form action='scripts/edite.php' method='post' name='editer' enctype='multipart/form-data'>";
echo "<table width=100% border=1 align=center>";
echo "<tr bgcolor='#FFFFFF'>";
if ($totenreg==0)
echo "<td colspan=6><h2>IL N'Y A PAS DE INDIVIDUS A EDITER</td>";
else
{
// choix des clients à modifier
while ($row=mysql_fetch_array($result))
{
echo "<h5>".$row["nom_ind"]."";//retourne une ligne de résultat MySQL sous la forme d'un tableau pour pouvoir les modifier
echo "<h5>".$row["prenom_ind"]."";
$nom=$row["prenom_ind"];
$prenom=$row["nom_ind"];
}
}
?>
mon probleme concerne le transfert de id_ind de la fiche choisi du fichier d'affichage des résultat a fiche
merci de votre aide