Précédent   Forum des professionnels en informatique > PHP > Outils > EasyPHP
EasyPHP Forum d'entraide sur EasyPHP : installation, utilisation, etc. Avant de poster -> Cours EasyPHP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 17/06/2007, 18h16   #1
Invité de passage
 
Inscription : juin 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : juin 2007
Messages : 11
Points : 0
Points : 0
Par défaut je ne recupere pas mes données

je ne trouve pa les données envoyées par le formulaire dans la table..
voici le code de la page formulaire:
rien n'est afficher sur la table "client" dans la BD lors de l'envoi de ce formulaire
juste l'auto_incr fonction .
voici le code MERCI POUR L'AIDE:

Code :
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
<?php
// Active tout les warning. Utile en phase de développement
// En phase de production, remplacer E_ALL par 0
error_reporting(0);
 
// Inclus le fichier contenant les fonctions personalisées
include_once 'mes_fonctions.php';
 
// Fonction de connexion à la base de données
connexion_DB('coldeq');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Devis</title>
 
<script language="JavaScript" >
var mail = /^[\w\-]+(\.[\w\-]+)*@[\w\-]+(\.[\w\-]+)*\.[\w\-]{2,}$/;
 
function estCeUnMail(champs) {
reponse=mail.test(champs.value)
if (reponse==false) {
return false;
}
else
{return true;}
}
 
function testmail(champs) {
reponse=estCeUnMail(champs);
if (reponse==false) {alert("Adresse mail Invalide");}
}
function test()
{
if(document.fformula.zn.value==""||document.fformula.zp.value=="")
{
alert("Verifier le champ Nom et Prénom SVP");
document.fformu1a.zn.focus();
document.fformu1a.zp.focus();
return false;
}
 
if(document.form1.zadr.value=="")
{
alert("Verifier le champ Adresse SVP");
document.fformu1a.adr.focus();
return false;
}
if(document.fformu1a.ztel.value=="" ) 
{
alert("Verifier le numéro de téliphone");
document.fformu1a.ztel.focus();
return false;
}
if(document.form1.zeml.value=="" ) 
{
alert("Verifier votre Email SVP");
document.fformu1a.zeml.focus();
return false;
}
if (document.getElementById('ch'||'ch2'||'ch3'||'ch4'||'ch5'||'ch6'||'ch7'||'ch8'||'ch9').checked)
{ 
fformula.action = 'verif.php'; 
}
 
else { // Si la checkbox n'est pas cochée 
fformula.action = 'devis.php'; 
} 
return true;
}
</script>
</head>
 
<body background="images/froid.jpg">
<p align="center">&nbsp;&nbsp;&nbsp;</p>
<p align="center">&nbsp;</p>
<?php if(!isset($valid)){?>
<form name="fformula" method="post" action="<?php echo $php_self ?>" onSubmit="return test()">
<center><strong>Devis</strong></center>
<div align="center">
<p align="center">Veuillez remplir le formulaire.<br>
Les champs précédés d’une<font color="red" size=2> « * » sont obligatoires.</font>
</div>
<center>
<table width="45%" cellspacing="0">
<tr>
<th width="37%" scope="col">&nbsp;</th>
<th width="63%" scope="col">&nbsp;</th>
</tr><tr>
<td>Nom<font color="red" size=3>*</font>&nbsp;</td>
<td><input type="text" name="zn" maxlength=40>&nbsp;</td></tr>
<tr><td>Prénom<font color="red" size=3>*</font>&nbsp;</td>
<td><input type="text" name="zp" maxlength=40>&nbsp;</td></tr>
<tr><td>Société<font color="red" size=3>*</font>&nbsp;</td>
<td><input type="text" name="zs" maxlength=40>&nbsp;</td></tr>
<tr> <td>Adresse&nbsp;</td>
<td><input type="text" name="zadr" maxlength=40>&nbsp;</td></tr>
<tr><td>Tel<font color="red" size=3>*</font>&nbsp;</td>
<td><input type="text" name="ztel" maxlength=40>&nbsp;</td></tr>
<tr><td>Fax&nbsp;</td>
<td><input type="text" name="zfax" maxlength=40>&nbsp;</td></tr>
<tr><td>Email&nbsp;</td>
<td><input type="text" name="zeml" maxlength=40 onBlur="testmail(this.form.zeml)">&nbsp;</td></tr>
</table><br >
<center><table width="415">
<tr>
<td width="200"><div align="left"><strong>Marque de caisse :</strong> </div></td>
<td width="200"><div align="left"><strong>Type : </strong></div></td>
</tr>
<tr>
<td><label>
<div align="right">ISUZU
<input type="checkbox" name="ch" value="checkbox">
</div>
</label></td>
<td width="203"><label>
<select name="select">
<option>Choisissez votre type</option>
<option>DMax</option>
<option>NKR66L</option>
<option>NPR66</option>
<option>FSR33H</option>
<option>TFR</option>
</select>
</label></td></tr>
<tr>
<td><label> 
<div align="right">MITSUBISHI
<input type="checkbox" name="ch2" value="checkbox">
</div>
</label></td>
<td><label>
<select name="select2">
<option>Choisissez votre type</option>
<option>L200</option>
<option>L300</option>
<option>CANTER</option>
</select>
</label></td></tr>
<tr><td>
<label> 
<div align="right">IVECO
<input type="checkbox" name="ch3" value="checkbox">
</div>
</label>
</td><td><label>
<select name="select3">
<option>Choisissez votre type</option>
<option>EuroCargo</option>
<option>35 c11</option>
<option>65.9</option>
</select>
</label></td></tr>
<tr><td><label>
<div align="right">CITROEN
<input type="checkbox" name="ch4" value="checkbox">
</div>
</label></td>
<td><label>
<select name="select4">
<option>Choisissez votre type</option>
<option>Berlingo</option>
</select>
</label></td></tr>
<tr><td><label>
<div align="right">FORD
<input type="checkbox" name="ch5" value="checkbox">
</div>
</label>
<td><label>
<select name="select5">
<option>Choisissez votre type</option>
<option>Ranger</option>
<option>Transit</option>
</select>
</label></td></tr>
<tr>
<td><label>
<div align="right">RENAULT
<input type="checkbox" name="ch6" value="checkbox">
</div>
</label> 
<td><label>
<select name="select6">
<option>Choisissez votre type</option>
<option>Kango</option>
</select>
</label></td>
</tr>
<tr>
<td><label>
<div align="right">VOLKSWAGEN
<input type="checkbox" name="ch7" value="checkbox">
</div>
</label> 
<td><label>
<select name="select7">
<option>Choisissez votre type</option>
<option>Cady</option>
</select>
</label></td>
</tr>
<tr>
<td><label>
<div align="right">MERCEDES
<input type="checkbox" name="ch8" value="checkbox">
</div>
</label> 
<td><label>
<select name="select8">
<option>Choisissez votre type</option>
<option>Spinter</option>
<option>Vito</option>
</select>
</label></td>
</tr>
<tr>
<td><label></label> <label>
<div align="right">PEUGEOT
<input type="checkbox" name="ch9" value="checkbox">
</div>
</label>
<td><label>
<select name="select9">
<option>Choisissez votre type</option>
<option>Partner</option>
<option>Boxer</option>
</select>
</label></td>
</tr>
<tr>
<td><label>AUTRE
<input type="text" name="textfield">
</label> 
</tr>
</tab><td><label>Type
<input type="text" name="textfield2">
</label></td> 
<table height="32" width="571">
<tr>
<td height="21" width="152">Choisissez votre devise: &nbsp;</td>
<td height="21" width="405"> 
<input id="devise" type="radio" CHECKED value="Dinar" name="devise">
Dinar Tunisien&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input id="devise" type="radio" value="Dollar" name="devise">
Dollar Américain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input id="devise" type="radio" value="Euro" name="devise">
Euro&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp 
</td></tr></table>
 
<center> <table> 
<tr><td><input type="submit" value="valider" name="valid"></td>
<td><input type="reset" value="Annuler"></td></tr>
</table>
</form>
<?php
if(isset($ajout))
{
$strSQL="select * from client";
$res=$res=requete_SQL($strSQL);
$n=mysql_num_rows($res);
 
if($n==0)
{
$strSQL = "insert into client (`id_client`,`Nom`,`Prénom`,`Société`,`Adresse`,`Tel`,`Fax`,`Email` )VALUES('','$Nom','$Prénom','$Société','$Adresse','$Tel','$Fax','$Email')";
$res=requete_SQL($strSQL);
}
$res=requete_SQL($strSQL);
}
else
{
$n=$n+1;
$strSQL = "insert into client (`id_client`,`Nom`,`Prénom`,`Société`,`Adresse`,`Tel`,`Fax`,`email` )VALUES('','$Nom','$Prénom','$Société','$Adresse','$Tel','$Fax','$Email')";
$res=requete_SQL($strSQL);
}
}
?> 
</center> 
</body>
</html>
chawkiste est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/06/2007, 07h48   #2
Rédacteur
 
Avatar de Yoshio
 
Homme
Inscription : septembre 2005
Messages : 1 741
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 24
Localisation : Belgique

Informations forums :
Inscription : septembre 2005
Messages : 1 741
Points : 1 497
Points : 1 497
Si tu commencais par activé le error_reporting à E_ALL | E_STRICT ensuite tu pourrais peut etre isolé le problème et nous donner les fonctions requete_SQL.

Et ton id s'incrémente en lui passant une chaine vide ?
Yoshio est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/06/2007, 00h04   #3
Invité de passage
 
Inscription : juin 2007
Messages : 11
Détails du profil
Informations forums :
Inscription : juin 2007
Messages : 11
Points : 0
Points : 0
Par défaut comme dab

rien n'a marché
chawkiste est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 20h46.


 
 
 
 
Partenaires

Hébergement Web