Bonjour
Voilà plusieurs jours que je galère sur un script de modification.
je voudrais que les utilisateurs puissent modifier leurs inscriptions à un challenge.
Une requete leur renvoie la liste de leurs inscriptions. Ce que je voudrais bien réussir à faire c'est que le formulaire de modification
prenne les données de la ligne sélectionnée.
A ce jour,je n'ai le formulaire rempli qu'avec la première ligne de la liste.
Merci pour votre aide.
je vous joint les codes .
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
 
<?php 
ini_set("display_errors",-1);error_reporting(E_ALL);
 
 include ('header.php');
 
 
include ('../admin/includes/fonctions.php');
    if(isset($_SESSION['pseudo']) && $_SESSION['niveau'] == '2')
{
 
 
include ('../mysqlcnn.php');
include ('menucompet.php');
?>
 
<div id="corps">
 
 
<h1>liste des inscrits: CHALLENGE ADULTES</h1>
<div id="tableau">
<table>
    <tr>
 
    	<th>Id</th>
    	<th>jourc</th>
    	<th>heurec</th>
    	<th>nom</th>
		<th>prenom</th>
		<th>club</th>
		<th>nlicence</th> 
		<th>cat</th>
		<th>dis</th>
		<th>Gerer</th>
		<th>Supprimer</th>
    </tr>
<?php
 
//////////////////////////////////////////////////////////////////// fonction page start////////////////////////////////////////////////////////////////////////
if (empty($_GET["start"])) $start = 0;
else $start = $_GET["start"];
// on défini ici le nombre de membre qu'on affiche par pages
$nbpp = 15;
$ok = true;
if (!empty($choixconfirm))
{
if ($choixconfirm == "i") $ve = 0; else $ve = 1;
//On recupere les identifiants, les pseudo et les emails des utilisateurs
$req = mysql_query("select * from fuschaladult  from fuschaladult ASC limit $start, $nbpp;");
}
else 
$req = mysql_query("select * from fuschaladult order by nom ASC limit $start, $nbpp;");
 
 
while($dnn = mysql_fetch_array($req))
{
?>
 
	<tr>
 
    	<td><?php echo htmlentities($dnn['id']); ?></td>
    	<td><?php echo htmlentities($dnn['jourc']); ?></a></td>
    	<td><?php echo htmlentities($dnn['heurec']); ?></td>
    	<td><?php echo htmlentities($dnn['nom']); ?></td>
	<td><?php echo htmlentities($dnn['prenom']); ?></td>
	<td><?php echo htmlentities($dnn['club']); ?></a></td>
    	<td><?php echo htmlentities($dnn['nlicence']); ?></td>
    	<td><?php echo htmlentities($dnn['cat']); ?></td>
	<td><?php echo htmlentities($dnn['dis']); ?></td>
 
		<td><a href="adm_chaladult.php?o=<?php echo $dnn['jourc']; ?>&n=<?php echo $dnn['nlicence']; ?>&m=<?php echo $dnn['dis'] ;?>"><?php echo "Modifier" ; ?></a></td>
		<td><div align="center"><a href="sup_chaladult.php?o=<?php echo $dnn['jourc']; ?>&n=<?php echo $dnn['nlicence'] ;?>&m=<?php echo $dnn['dis'] ;?>">Supprimer</a></div></td>
    </tr>
<?php
}
?>
</table>
 
<?php
//////////////////////////////////////////////////////////////////// fonction page start////////////////////////////////////////////////////////////////////////
if (empty($_GET["start"])) $start = 0;
else $start = $_GET["start"];
// on défini ici le nombre de membre qu'on affiche par pages
$nbpp = 15;
$ok = true;
if (!empty($choixconfirm))
{
if ($choixconfirm == "i") $ve = 0; else $ve = 1;
//On recupere les identifiants, les pseudo et les emails des utilisateurs
$req = mysql_query("select * from fuschaladult  ASC limit $start, $nbpp;");
}
else 
$req = mysql_query("select * from fuschaladult order by nom ASC limit $start, $nbpp;");
 
//////////////////////////////////////////////////////////////////// fonction page start////////////////////////////////////////////////////////////////////////
?>
 
<div align="center">
 
 <?php
}
        else
{
?>
<div id="corps">
 
<h1>Vous n'avez pas le droit d'accéder à cette page</h1><br />
 
<?php
} ;
?> 
</div>
 </div>
 </div>
</div>
</h2>
</div> 
 </div>
</body>
</html>
Ci-dessous le code que je n'arrive pas à faire marcher.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
 
<?php
ini_set("display_errors",-1);error_reporting(E_ALL); 
@session_start;
 include ('header.php');
  include ('menucompet.php'); 
  include ("../mysqlcnn.php"); 
  $pseudo = ($_SESSION['pseudo']); 
?>
<div id="corps">
 
<hr>
 
<?php
 
	   if  (  !empty($_POST['jourc']) 
	&& !empty($_POST['heurec'])
	&& !empty($_POST['nom'])
	&& !empty($_POST['prenom'])
	&& !empty($_POST['club'])
	&& !empty($_POST['nlicence'])  
	&& !empty($_POST['cat'])
	&& !empty($_POST['dis'])
	 )
 
 
	  	  	{ 
 
 
				//$id = mysql_real_escape_string($_POST['id']);
				$jourc = mysql_real_escape_string($_POST['jourc']);
				$heurec = mysql_real_escape_string($_POST['heurec']);
				$nom = mysql_real_escape_string($_POST['nom']);
				$prenom = mysql_real_escape_string($_POST['prenom']);
				$club = mysql_real_escape_string($_POST['club']);
				$nlicence = mysql_real_escape_string($_POST['nlicence']);
				$cat = mysql_real_escape_string($_POST['cat']);
				$dis = mysql_real_escape_string($_POST['dis']);
 
				     if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="09octobre")) 
				    	{ 
						$tble = "chaladult1";
						$nbp = 20;
						} 
					   else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="20novembre"))
				   		{ 
						$tble = "chaladult2";
						$nbp = 30;
						} 
				  	 else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="11decembre"))
				    	{ 
						$tble = "chaladult3";
						$nbp = 18;					  						
						} 
					  else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="22janvier"))
				   		{ 
						$tble = "chaladult4";
						$nbp = 16;
						} 	 
						 else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="04mars"))
				   		{ 
						$tble = "chaladult5";
						$nbp = 30;
						} 
 
			//On modifie les informations de l'utilisateur avec les nouvelles valeurs
	                    if(mysql_query('update fuschaladult set jourc="'.$jourc.'", heurec="'.$heurec.'", nom="'.$nom.'", prenom="'.$prenom.'", club="'.$club.'", nlicence="'.$nlicence.'", cat="'.$cat.'", dis="'.$dis.'"  where nlicence="'.$nlicence.'" && dis="'.$dis.'" && jourc="'.$jourc.'" '))
 
					  		{
							//Si ca a fonctionne, on naffiche pas le formulaire
							//$form = false;
							 mysql_query('update '.$tble.' set jourc="'.$jourc.'", heurec="'.$heurec.'", nom="'.$nom.'", prenom="'.$prenom.'", club="'.$club.'", nlicence="'.$nlicence.'", cat="'.$cat.'", dis="'.$dis.'"  where nlicence="'.$nlicence.'" && dis="'.$dis.'" && jourc="'.$jourc.'" ');
 
?>
 
		  <script type="text/javascript">
 
      window.setTimeout
	  ('document.location.href="admin_chaladult.php"',2000);
 
    </script> 
		<h2>
 
 
Les infos du membre ont été modifiées avec succès !
<br />
<br />
Redirection...
 
</h2>
 
		<?php	  
			  exit();
 
					  }
						}
						else
						{
							//Sinon on dit quil y a eu une erreur
							$form = true;
							$message = 'Une erreur est survenue lors des modifications.';
						}
 
	 	if(isset($_POST['id'],$_POST['jourc'],$_POST['heurec'],$_POST['nom'],$_POST['prenom'],$_POST['club'],$_POST['nlicence'],$_POST['cat'],$_POST['dis']))
		{
 
				//$id = htmlentities($_POST['id']);
				$nlicence = mysql_real_escape_string($_POST['nlicence']); 
				$dis = mysql_real_escape_string($_POST['dis']);
				$jourc = mysql_real_escape_string($_POST['jourc']);
		}
 
	  else
		{
			//Sinon, on affiche les donnes a partir de la base de donnee  
			$dnn = mysql_fetch_array(mysql_query('select * from fuschaladult where pseudo="'.$pseudo.'"'));
			//$id = htmlentities($dnn['id']);
			$jourc = htmlentities($dnn['jourc']);
			$heurec = htmlentities($dnn['heurec']);
			$nom = htmlentities($dnn['nom']);
			$prenom = htmlentities($dnn['prenom']);
			$club = htmlentities($dnn['club']);
			$nlicence = htmlentities($dnn['nlicence']);
			$cat = htmlentities($dnn['cat']);
			$dis = htmlentities($dnn['dis']);
 
		 }	 
 
		//On affiche le formulaire
?>
 
<form action="adm_chaladult.php?o=<?php echo $dnn['jourc']; ?>&n=<?php echo $dnn['nlicence']; ?>&m=<?php echo $dnn['dis'] ;?>" method="post">
Vous pouvez modifier les informations de <?php echo "$nom"," ","$prenom";?><br /><br />
Jour de tir:<input type="text" name="jourc" value="<?php echo $jourc; ?>" /><br /><br /> 
Heure de tir:<input type="text" name="heurec" value="<?php echo $heurec; ?>" /><br /><br /> 
Nom d'utilisateur:<input type="text" name="nom" value="<?php echo $nom; ?>" /><br /><br />
Prenom:<input type="text" name="prenom" value="<?php echo $prenom; ?>" /><br /><br />
Club:<input type="text" name="club" value="<?php echo $club; ?>" /><br /><br />
Nlicence:<input type="text" name="nlicence" value="<?php echo $nlicence; ?>" /><br /><br />
Categorie :<input type="text" name="cat" value="<?php echo $cat; ?>" /><br /><br />
Discipline:<input type="text" name="dis" value="<?php echo $dis; ?>" /><br /><br />
 
	<br /><br />
<input type="submit" value="valider les modifications" /><br />
</form>
 
</div>
 
 </div>
 </div>
</body>
</html>
Je suis sous free .