Bonjour voici les commande suivantes:
ce premier code me permet de selection un prestataire, lorsque je selection le prestataire, le bouton afficher en bas me permet de lancer le deuxième code le formulaire qui me permet de recupere le prestataire selection et de l'afficher, malheuresement ce code n'est exécuté.
le message suivant est affcihée
"an unhandled win32 exception occured in httpd.exe[6980]"
ce deuxieme code permet de recuperer et afficher le prestataire selectionné
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 <html> <head> <meta http-equiv="Content-Language" content="fr"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Sélectionnez un prestataire </title> </style> </head> <body> <p> </p> <p align="center"> <u><font face="Arial" size="4" color="#0000FF">Sélectionnez un prestataire</font></u></p> <p align="left"> </p> <div align="center"> <?php //include("C:\wampserveur\www\GD_BASE\connexion.inc.php"); include("../connexion.inc.php"); //include("c:/wamp/www/GDFOR/connexion.inc.php"); //$db = mysql_connect('localhost', 'root', '') or die('Erreur de connexion '.mysql_error()); //mysql_select_db('entreprise',$db) or die('Erreur de selection '.mysql_error()); $result = mysql_query("select `raison_sociale` from `prestataire`"); //mysql_close($result); ?> <form name="frm" method="POST" action=""> <table width="40%" border="0" align="center" id="table1"> <tr> <td width="289"><font size="3" face="Arial, Helvetica, sans-serif">Nom du prestataire </font> <select name="raison_sociale" size="1" > <option value="" selected> <?php while($raison_sociale = mysql_fetch_array($result)) {?> <option value='<?php echo $raison_sociale['raison_sociale'] ?>' /> <?php echo $raison_sociale['raison_sociale'] ; } ?> </select></td> <td width="60"> <div align="left"> <!-- <input type="submit" value="Afficher" style="float: right"> --> <?php if(isset($_POST["button"])) { //echo '<input type="button" value="Afficher" name="button">'; //echo 'onclick="javascript:location.href=\'../GD_BASE/prestataire/form_creaprestataire.php\'"'; } ?> <center> <input type="button" value="Afficher" name="button" onclick="javascript:location.href='../prestataire/form_affichprestataire.php'"> </center> </div></td> </tr> </table> </form> </body> </html>
ce code me permet la connexion à la base de donnée.
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
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 <html> <head> <meta http-equiv="Content-Language" content="fr"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Consultation ou modification d'un prestataire</title> <script language="javascript"> function verif() {mes=""; if(document.frm.raison_sociale.value==''){mes=mes+"\n-Raison sociale manquant";} if(document.frm.adresse.value==''){mes=mes+"\n-Adresse manquant";} if(document.frm.CP.value==''){mes=mes+"\n-Code postal manquant";} if(document.frm.ville.value==''){mes=mes+"\n-Ville manquant";} if(document.frm.tel.value==''){mes=mes+"\n-Téléphone manquant";} if(document.frm.mail.value==''){mes=mes+"\n-Courriel manquant";} if(document.frm.nom_responsable.value==''){mes=mes+"\n-Nom du responsable manquant";} if(mes!=''){alert("A completer :"+mes);return false;}else{return true;} } </script> </head> <body> <?php //$db = mysql_connect('localhost', 'root', '') or die('Erreur de connexion '.mysql_error()); //mysql_select_db('entreprise',$db) or die('Erreur de selection '.mysql_error()); include("../connexion.inc.php"); $raison_sociale = str_replace('\'',''',$_POST["raison_sociale"]); $result = mysql_query("select * from `prestataire` where raison_sociale='".$_POST["raison_sociale"]."'"); while ($row = mysql_fetch_object($result)) { $champ1=$row->id; $champ2=$row->raison_sociale; $champ3=$row->adresse; $champ4=$row->CP; $champ5=$row->ville; $champ6=$row->tel; $champ7=$row->fax; $champ8=$row->mail; $champ9=$row->nom_responsable; $champ10=$row->tel_responsable; $champ11=$row->GSM_responsable; $champ12=$row->fax_responsable; $champ13=$row->mail_responsable; $champ14=$row->nom_contact; $champ15=$row->tel_contact; $champ16=$row->GSM_contact; $champ17=$row->fax_contact; $champ18=$row->mail_contact; $champ19=$row->metiers_exerces; $champ20=$row->remarques; } mysql_close(); ?> <p> </p> <p align="center"><u><font size="5" color="#0000FF" face="Arial">Consultation ou modification d'un nouveau prestataire</font></u></p> <div align="center"> <form name="frm" method="POST" action="upprestataire.php" onSubmit="return verif()"> <table border="0" width="44%" id="table1" cellspacing="1"> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Identification : </font></td> <td align="left" valign="top" width="53%"> <input type="hidden" name="id" value="<?php echo $champ1;?>"> <?php echo $champ1;?></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Raison sociale : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="raison_sociale" value="<?php echo $champ2;?>" size="50"> </td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Adresse : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="adresse" value="<?php echo $champ3;?>"size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Code postal : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="CP" value="<?php echo $champ4;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Ville : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="ville" value="<?php echo $champ5;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Téléphone : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="tel" value="<?php echo $champ6;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Télécopie : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="fax" value="<?php echo $champ7;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Courriel : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="mail" value="<?php echo $champ8;?>" size="50"></td> </tr> <tr> <td align="left" colspan="2" valign="top"> <hr noshade size="1" width="95%"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Nom du responsable : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="nom_responsable" value="<?php echo $champ9;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Téléphone du responsable : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="tel_responsable" value="<?php echo $champ10;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Téléphone portable du responsable : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="GSM_responsable" value="<?php echo $champ11;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Télécopie du responsable : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="fax_responsable" value="<?php echo $champ12;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Courriel du responsable : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="mail_responsable" value="<?php echo $champ13;?>" size="50"></td> </tr> <tr> <td align="left" colspan="2" valign="top"> <hr noshade size="1" width="95%"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Nom du contact : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="nom_contact" value="<?php echo $champ14;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Téléphone du contact : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="tel_contact" value="<?php echo $champ15;?>"size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Téléphone portable du contact :</font></td> <td align="left" valign="top" width="53%"> <input type="text" name="GSM_contact" value="<?php echo $champ16;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Télécopie du contact : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="fax_contact" value="<?php echo $champ17;?>" size="50"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Courriel du contact : </font></td> <td align="left" valign="top" width="53%"> <input type="text" name="mail_contact" value="<?php echo $champ18;?>"size="50"></td> </tr> <tr> <td align="left" colspan="2" valign="top"> <hr noshade size="1" width="95%"></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Métiers exercés dans l'entreprise : </font></td> <td align="left" valign="top" width="53%"> <textarea rows="5" name="metiers_exerces" cols="39"value="<?php echo $champ19;?>"> <?php echo $champ19;?></textarea></td> </tr> <tr> <td align="left" width="35%" valign="top"> <font face="Arial" size="2">Observation : </font></td> <td align="left" valign="top" width="53%"> <textarea rows="5" name="remarques" cols="39" value="<?php echo $champ20;?>"> <?php echo $champ20;?></textarea></td> </tr> <tr> <td align="left" width="35%" valign="top"> </td> <td align="left" valign="top" width="53%"> </td> </tr> <tr> <td align="center" width="89%" valign="top" colspan="2"> <input type="submit" value="Envoyer" name="B1" style="float: center"><input type="reset" value="Rétablir" name="B2" style="float: center"></td> </tr> <tr> <td align="center" width="89%" valign="top" colspan="2"> <p> </p></td> </tr> </table> </form> </div> </body> </html>
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 <?php $serveur = "localhost"; $nom_base = "DG_BASE_db"; $login = "mali2012"; $mp = "bamako"; // connexion a MySQL $con=mysql_connect ($serveur,$login,$mp) or die ('ERREUR '.mysql_error()); // sélection de la base de données mysql_select_db ($nom_base,$con) or die ('ERREUR '.mysql_error()); // TEST DE CONNEXION if (mysql_connect ($serveur,$login,$mp)) { echo 'connexion réussie'; } else { echo 'connexion impossible...'.mysql_error(); } // fermeture de la base //mysql_close($con); ?>
Partager