SLT je trouve un grand probléme dans le codage php.
mon prob.
je suis entraint de cree un site web educatif et
apres codification d'une page pour inserer; le code m'affiche undefined index dans tel champs et voici mon code:
Code php : 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 <?php //connection au serveur $cnx = mysql_connect( "localhost", "root", "" ) ; $db = mysql_select_db("centre de formation bullarejia",$cnx) ; //récupération des valeurs des champs: $Cin=$_POST["Cin"]; $Nom=$_POST["Nom"]; $Prenom=$_POST["Prenom"]; $Sexe=$_POST["Sexe"]; $DNaissance=$_POST["DNaissance"]; $Adresse=$_POST["Adresse"]; $Tel=$_POST["Tel"]; $E_Mail=$_POST["E_Mail"]; $Motdepasse=$_POST["Motdepasse"]; $Login=$_POST["Login"]; $requete= "INSERT INTO enseignant ( `CinE` , `Nom` , `Prenom` , `Sexe` , `DNaissance` , `Adresse` , `Tel` , `E-Mail` , `Login` , `Mot de passe` ) VALUES ('$Cin', '$Nom', '$Prenom', '$Sexe', '$DNaissance', '$Adresse', '$Tel', '$E_Mail', 'Login', '$Motdepasse')"; $sql = mysql_query($requete, $cnx) or die( mysql_error() ) ; if (($Cin <> "") && ($Nom <> "")&& ($Prenom <> "")&& ($Login <> "")) { echo "Merci votre inscription est confirmé!"; exit; } ?>
Code html : 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-image: url(fond de page mosaique.JPG); background-image: url(fond%20de%20page%20mosaique.JPG); } .Style18 {color: #A52DD2; font-size: x-large; font-family: Elephant; } .Style19 {font-size: 24px; color: #990000; font-style: italic; font-weight: bold; } .Style20 { font-size: 18px; font-style: italic; font-weight: bold; font-family: "Comic Sans MS"; } .Style28 {color: #FF0000} .Style31 {color: #999999} --> </style></head> <body> <table width="801" height="142" border="1" align="center"> <tr> <td width="184"><img src="logo.JPG" width="186" height="136" /></td> <td width="566"><div align="center"><span class="Style18">Etablissement Bullarejia de Formation</span></div> <div align="center"><span class="Style19"><u>Agrée par l’Etat sous le n° : 07/051/32</u></span></div></td> </tr> </table> <table width="801" border="0" align="center" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="801" height="66"><marquee width=100% behavior=alternate direction=left align=middle> <div align="center" class="Style20">Bienvenue dans l'espace Administrateur </div> </marquee> </td> </tr> </table> <table width="801" border="0" align="center" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="278" height="363" valign="top"><table width="76%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="219" height="140" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="174" height="140"><p><img src="enseignant.JPG" width="193" height="130" /></p> <p align="center"><strong>Enseignant</strong></p></td> </tr> </table> </td> </tr> <tr> <td height="13"></td> </tr> <tr> <td height="34" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="174" height="34"><form id="form1" name="form1" method="post" action=""> <label> <div align="center"> <input type="submit" name="Submit" value="Liste Enseignant" /> </div> </label> </form> </td> </tr> </table> </td> </tr> <tr> <td height="17"></td> </tr> <tr> <td height="30" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="174" height="30"><form id="form2" name="form2" method="post" action="Administrateursuppensei.php"> <label> <div align="center"> <input name="Submit2" type="submit" value="Supprimer Eseignant" /> </div> </label> </form> </td> </tr> </table> </td> </tr> <tr> <td height="41"> </td> </tr> </table> </td> <td width="29"> </td> <td colspan="5" rowspan="2" valign="top"><table width="122%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="293" height="418"><p align="center"><strong>Ajout Eseignant</strong></p> <table width="125%" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999"> <!--DWLayoutTable--> <tr> <td width="92" height="35" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="35"><div align="center">N° carte d'identité <span class="Style28">*</span></div></td> </tr> </table></td> <td width="228" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="35"><label> </label> <div align="center"> <input type="text" name="CinE" /> </div></td> </tr> </table></td> </tr> <tr> <td height="36" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="36"><div align="center">Nom<span class="Style28">*</span> : </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="36"><label> </label> <div align="center"> <input type="text" name="Nom" /> </div></td> </tr> </table></td> </tr> <tr> <td height="38" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="38"><div align="center">Prenom<span class="Style28">*</span> : </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="38"><label> </label> <div align="center"> <input type="text" name="Prenom" /> </div></td> </tr> </table></td> </tr> <tr> <td height="36" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="36"><div align="center">Sexe<span class="Style28">*</span> : </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="36"><label> </label> <div align="center"> <select name="Sexe"> <option>Masculin</option> <option>Feminin</option> </select> <span class="Style31">............. </span></div></td> </tr> </table></td> </tr> <tr> <td height="37" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="37"><div align="center">Date de Naissance <span class="Style28">*</span></div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="37" valign="top"><label> </label> <div align="center"> <input name="DNaissance" type="text" value="jj-mm-aaaa" /> </div></td> </tr> </table></td> </tr> <tr> <td height="39" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="39"><div align="center">Adresse<span class="Style28">*</span> : </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="39"><label> </label> <div align="center"> <input type="text" name="Adresse" /> </div></td> </tr> </table></td> </tr> <tr> <td height="37" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="37"><div align="center">Tel <span class="Style28">*</span> : </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="37"><label> </label> <div align="center"> <input type="text" name="Tel" /> </div></td> </tr> </table></td> </tr> <tr> <td height="34" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="34"><div align="center">E-Mail <span class="Style28">*</span> : </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="34"><label> </label> <div align="center"> <input name="E-Mail" type="text" value="Exemple@exemple.fr" /> </div></td> </tr> </table></td> </tr> <tr> <td height="40" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="40"><div align="center">Login <span class="Style28">* </span>: </div></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="40"><label> </label> <div align="center"> <input type="text" name="Login" /> </div></td> </tr> </table></td> </tr> <tr> <td height="48" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="184" height="48"><p align="center">Mot de Passse <span class="Style28">*</span> : </p></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="212" height="48"><label> </label> <div align="center"> <input type="text" name="Mot de passe" /> </div></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td height="1"></td> </tr> </table></td> <td width="15"> </td> </tr> <tr> <td height="116"></td> <td></td> <td></td> </tr> <tr> <td height="36"></td> <td></td> <td width="92"> </td> <td colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="288" height="36"><p align="center" class="Style28">* : Tous les champs sont obligatoire. </p> </td> </tr> </table> </td> <td width="61"> </td> <td></td> </tr> <tr> <td height="15"></td> <td></td> <td></td> <td width="158"></td> <td width="156"></td> <td width="12"></td> <td></td> <td></td> </tr> <tr> <td height="47"></td> <td></td> <td></td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="158" height="47"><form id="form3" name="form3" method="post" action="ajotenseiconf.php"> <label> <div align="center"> <input type="submit" name="Submit3" value="Valider" /> </div> </label> </form> </td> </tr> </table> </td> <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="156" height="47"><form id="form4" name="form4" method="post" action="Administrateur.php"> <label> <div align="center"> <input type="submit" name="Submit4" value="Acceuil" /> </div> </label> </form> </td> </tr> </table> </td> <td> </td> <td></td> <td></td> </tr> <tr> <td height="229"></td> <td></td> <td></td> <td> </td> <td></td> <td></td> <td></td> <td></td> </tr> </table> </body> </html>
Merci d'avence de m'aider
Partager