Bonsoir,
J'ai fais une connexion a un fichier s'appelant probap.php via un ajax ce trouvant dans prob.php
Lien de la page ou ce trouve l'ajax : http://livrez-moi.fr/probap.php?idme...aurant=1&niv=6
Lien ou point l'ajax : http://livrez-moi.fr/prob.php
Code Page prob.php
Code Page probap.php
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
225
226
227
228 <div id="txtHint"> <script type="text/javascript"> function MiseAjourCaddie(str,str1,str2) { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { var e = document.getElementById('txtHint'); /*On ajoute le contenu de la réponse dans le Dom du document*/ e.innerHTML = xmlhttp.responseText; /*On évalue le javascript contenu dans les dom*/ var scripts = e.getElementsByTagName('script'); for(var i=0; i < scripts.length;i++) { /*Sous IE il faut faire un execScript pour que les fonctions soient définie en globale*/ if (window.execScript) { /*On replace les éventuels com' html car IE n'aime pas ça*/ window.execScript(scripts[i].text.replace('<!--','')); } /*Sous les autres navigateurs on fait un window.eval*/ else { window.eval(scripts[i].text); } } } } xmlhttp.open("GET","http://livrez-moi.fr/probap.php?idmenu="+str+"&niv="+str1+"&idrestaurant="+str2+"",true); xmlhttp.send(); } </script> <div class="container"> <!-- #messages-console --> <!-- EOF: #messages-console --> <div class="row"> <section class="col-md-8"> <!-- #main --> <div id="main" class="clearfix"> <!-- EOF:#content-wrapper --> <div id="content-wrapper"> <h1 class="page-title">Forums</h1> <!-- #tabs --> <div class="tabs"> </div> <!-- EOF: #tabs --> <!-- #action links --> <ul class="action-links"> <li><a href="/user/login?destination=forum">Connectez-vous</a> pour poster un nouveau message dans le forum.</li> </ul> <!-- EOF: #action links --> <div class="region region-content"> <section id="block-system-main" class="block block-system clearfix clearfix"> <div id="forum"> <p> <a href="#" onClick="MiseAjourCaddie('<?php echo"1"; ?>','<?php echo"6"; ?>','<?php echo"1"; ?>');">tester ajax</a></p> <?php // // Aenea - www.beaenea.com // Bootstrap BootstrapShoppingCart for codecanyon.net // require_once "cart/cart/BootstrapShoppingCart/config.php"; // load settings file require_once "cart/cart/BootstrapShoppingCart/BootstrapShoppingCart.php"; // load class BootstrapShoppingCart ?> <script src="cart/cart/vendor/jquery-2.1.0.min.js"></script> <script src="cart/cart/vendor/jquery-ui-1.10.4.custom.min.js"></script> <script src="cart/cart/vendor/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script> <!-- BootsrapBootstrapShoppingCart.js --> <script src="cart/cart/BootstrapShoppingCart/BootstrapShoppingCart.js"></script> <script src="cart/cart/vendor/jquery-2.1.0.min.js"></script> <script src="cart/cart/vendor/jquery-ui-1.10.4.custom.min.js"></script> <script> $(document).ready(function() { // show current shoppingcart $("#BSCart").load("cart/cart/BootstrapShoppingCart/addproduct_vertical.php"); // anim buttons categories $('#animation_slideDown').addClass("slideDown"); }); </script> <?php include("connect.php"); $idrestaurant="1"; $_SESSION[pseudo]="selre"; $_SESSION[idres]="$idrestaurant"; $_GET[idrestaurant]="1"; $niv=$_GET[niv]; $idmenu=$_GET[idmenu]; $niv=$_GET[niv]; $nivaff="$_GET[niv]"; $Requete1l = "SELECT * FROM FONC_menu_special WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION'"; $Requete1s = "SELECT * FROM FONC_menu_special WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION'"; //echo"-- $Requete1l --"; $Result1l = mysql_query($Requete1l); $tourniv1l="0"; $niv1l="niv2"; while($row1l = mysql_fetch_array($Result1l)) { $tourniv1l=$tourniv1l+1; $nomaf=$row1l["nom"]; $nom=$row1l["nom"]; $img=$row1l["img"]; $idbase=$row1l["id"]; $nom = str_replace(" ","","$nom"); if($img == ""){$img="nopic.jpg";} ?> <style> .tpod{ }</style> <?php } ?> <?php //fin while niv1 if($tourniv1l == "0"){ // echo"hjkl"; $Requete1 = "SELECT * FROM bsc_products WHERE idrestaurant='$idrestaurant' AND menu='$_GET[idmenu]' AND sousmenu='$_GET[niv]'"; $Result1 = mysql_query($Requete1); $tournivres="0"; $niv1="niv1"; while($row1 = mysql_fetch_array($Result1)) { $tournivres=$tournivres+1; $nomaf=$row1["nom"]; $ida=$row1["id"]; $nom=$row1["name"]; $price=$row1["price"]; $idbase=$row1["id"]; //$nom = str_replace(" ","","$nom"); ?> <div class="col-sm-4 col-md-4 product" data-id="<?php echo"$ida"; ?>" data-type="" data-quantity="1"> <div class="thumbnail"> <img src="cart/cart/assets/cloth_c7.jpg" alt="product 7" class="img-responsive"> <div class="caption"> <p> <?php echo"$nom"; ?><br /><br /><span class="price"><?php echo"$price"; ?> </span> </p> <div style="height: 40px;"></div> <p align="center"> <a href="cart/cart/product_sheet.php?id=<?php echo"$ida"; ?>" class="btn btn-default"><i class="icon-plus"></i>More</a> <a href="#" class="btn btn-success addproduct"><i class="icon-shopping-cart"></i>Add</a> </p> </div> </div> </div> <?php } ?><?php if($tournivres = "1" || $tournivres = "2" || $tournivres = "3"){echo"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";} $nivaffm=$_GET[niv]-1; } $_SESSION[idmenuav]=$_GET[idmenu]; ///////////////////FIN NIV1//////////////////// ///////////////////FIN NIV1//////////////////// ///////////////////FIN NIV1//////////////////// $nivm=$_GET[niv]-1; ?> <table width="580" height="1" border="0" cellspacing="0" cellpadding="0" style="height:1px; width:580px; border:0px;"> <tr> <td></td> </tr> </table> <?php //echo"<p><a href=\"http://livrez-moi.fr/1.php?idmenu=1&idrestaurant=$idrestaurant&niv=$nivm\">Retour<h1></h1> arriere -----</a></p>"; ?> </section> <!-- /.block --> </div>
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
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
367
368
369
370
371
372
373
374
375
376
377
378 <div class="container"> <!-- #messages-console --> <!-- EOF: #messages-console --> <div class="row"> <section class="col-md-8"> <!-- #main --> <div id="main" class="clearfix"> <!-- EOF:#content-wrapper --> <div id="content-wrapper"> <h1 class="page-title">Forums</h1> <!-- #tabs --> <div class="tabs"> </div> <!-- EOF: #tabs --> <!-- #action links --> <ul class="action-links"> <li><a href="/user/login?destination=forum">Connectez-vous</a> pour poster un nouveau message dans le forum.</li> </ul> <!-- EOF: #action links --> <div class="region region-content"> <section id="block-system-main" class="block block-system clearfix clearfix"> <div id="forum"> <p> <a href="#" onClick="MiseAjourCaddie('0','1','4');">ttt</a></p> <?php // // Aenea - www.beaenea.com // Bootstrap BootstrapShoppingCart for codecanyon.net // //require_once "cart/cart/BootstrapShoppingCart/config.php"; // load settings file //require_once "cart/cart/BootstrapShoppingCart/BootstrapShoppingCart.php"; // load class BootstrapShoppingCart ?> <script src="http://livrez-moi.fr/cart/cart/vendor/jquery-2.1.0.min.js"></script> <script src="http://livrez-moi.fr/cart/cart/vendor/jquery-ui-1.10.4.custom.min.js"></script> <script src="http://livrez-moi.fr/cart/cart/vendor/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script> <!-- BootsrapBootstrapShoppingCart.js --> <script src="http://livrez-moi.fr/cart/cart/BootstrapShoppingCart/BootstrapShoppingCart.js"></script> <script src="http://livrez-moi.fr/cart/cart/vendor/jquery-2.1.0.min.js"></script> <script src="http://livrez-moi.fr/cart/cart/vendor/jquery-ui-1.10.4.custom.min.js"></script> <script>alert('test')</script> <script> $(document).ready(function() { // show current shoppingcart $("#BSCart").load("http://livrez-moi.fr/cart/cart/BootstrapShoppingCart/addproduct_vertical.php"); // anim buttons categories $('#animation_slideDown').addClass("slideDown"); }); </script> <?php include("connect.php"); $idrestaurant="1"; $_SESSION[pseudo]="selre"; $_SESSION[idres]="$idrestaurant"; $_GET[idrestaurant]="1"; $niv=$_GET[niv]; $idmenu=$_GET[idmenu]; $niv=$_GET[niv]; $nivaff="$_GET[niv]"; echo"#$_GET[niv]#"; if($_GET[niv]=="" || $_GET[niv]=="0"){ $Requete1l = "SELECT * FROM FONC_menu_special WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION'"; $Requete1s = "SELECT * FROM FONC_menu_special WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION'"; echo"wxsdfhjklm"; $nivaff="1"; } if($_GET[niv]=="1"){ $Requete1l = "SELECT * FROM FONC_menu_special1 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special1 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } if($_GET[niv]=="2"){ $Requete1l = "SELECT * FROM FONC_menu_special2 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special2 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } if($_GET[niv]=="3"){ $Requete1l = "SELECT * FROM FONC_menu_special3 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special3 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } if($_GET[niv]=="4"){ $Requete1l = "SELECT * FROM FONC_menu_special4 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special4 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } if($_GET[niv]=="5"){ $Requete1l = "SELECT * FROM FONC_menu_special5 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special5 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } if($_GET[niv]=="6"){ $Requete1l = "SELECT * FROM FONC_menu_special6 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special6 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } if($_GET[niv]=="7"){ $Requete1l = "SELECT * FROM FONC_menu_special7 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; $Requete1s = "SELECT * FROM FONC_menu_special7 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; } if($_GET[niv]=="8"){ $Requete1l = "SELECT * FROM FONC_menu_special8 WHERE idrestaurant='$idrestaurant' AND nom!='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $Requete1s = "SELECT * FROM FONC_menu_special8 WHERE idrestaurant='$idrestaurant' AND nom='CONFIGURATION' AND idmenu='$_GET[idmenu]'"; $nivaff=$_GET[niv]+1; } ////////////////select configuration $Result1s = mysql_query($Requete1s); $row1s = mysql_fetch_array($Result1s); $titre=$row1s["titre"]; ?> <div align="center" style="font-size:24px;"><?php echo"$titre"; ?> </div><br><?php /////////fin select conf //echo"-- $Requete1l --"; $Result1l = mysql_query($Requete1l); $tourniv1l="0"; $niv1l="niv2"; while($row1l = mysql_fetch_array($Result1l)) { $tourniv1l=$tourniv1l+1; $nomaf=$row1l["nom"]; $nom=$row1l["nom"]; $img=$row1l["img"]; $idbase=$row1l["id"]; $nom = str_replace(" ","","$nom"); if($img == ""){$img="nopic.jpg";} ?> <style> .tpod{ }</style> <table width="100" height="100" border="0" cellspacing="0" cellpadding="0" style="height:100px; width:100px; float:left;"> <tr> <td><img src="cimgcat/<?php echo"$img"; ?>"> </td> </tr> <tr> <td><div align="center"> <p><a href="#" onClick="MiseAjourCaddie('<?php echo"$idbase"; ?>','<?php echo"$nivaff"; ?>','<?php echo"$idrestaurant"; ?>');"><?php echo"$nomaf"; ?></a></p> </div></td> </tr> </table> <?php } ?> <?php //fin while niv1 if($tourniv1l == "0"){ // echo"hjkl"; $Requete1 = "SELECT * FROM bsc_products WHERE idrestaurant='$idrestaurant' AND menu='$_GET[idmenu]' AND sousmenu='$_GET[niv]'"; $Result1 = mysql_query($Requete1); $tournivres="0"; $niv1="niv1"; while($row1 = mysql_fetch_array($Result1)) { $tournivres=$tournivres+1; $nomaf=$row1["nom"]; $ida=$row1["id"]; $nom=$row1["name"]; $price=$row1["price"]; $idbase=$row1["id"]; //$nom = str_replace(" ","","$nom"); ?> <div class="col-sm-4 col-md-4 product" data-id="<?php echo"$ida"; ?>" data-type="" data-quantity="1"> <div class="thumbnail"> <img src="cart/cart/assets/cdcloth_7.jpg" alt="product 7" class="img-responsive"> <div class="caption"> <p> <?php echo"$nom"; ?><br /><br /><span class="price"><?php echo"$price"; ?> </span> </p> <div style="height: 40px;"></div> <p align="center"> <a href="cart/cart/product_sheet.php?id=<?php echo"$ida"; ?>" class="btn btn-default"><i class="icon-plus"></i>More</a> <a href="#" class="btn btn-success addproduct"><i class="icon-shopping-cart"></i>Add</a> </p> </div> </div> </div> <?php } if($tournivres = "1" || $tournivres = "2" || $tournivres = "3"){echo"<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";} $nivaffm=$_GET[niv]-1; } $_SESSION[idmenuav]=$_GET[idmenu]; ///////////////////FIN NIV1//////////////////// ///////////////////FIN NIV1//////////////////// ///////////////////FIN NIV1//////////////////// $nivm=$_GET[niv]-1; ?> <table width="580" height="1" border="0" cellspacing="0" cellpadding="0" style="height:1px; width:580px; border:0px;"> <tr> <td></td> </tr> </table> <?php echo"<p><a href=\"http://livrez-moi.fr/1.php?idmenu=1&idrestaurant=$idrestaurant&niv=$nivm\">Retour arriere -----</a></p>"; ?> </div> </section> <!-- /.block --> </div> </div> <!-- EOF:#content-wrapper --> </div> <!-- EOF:#main --> </section> <aside class="col-md-4"> <!--#sidebar-second--> <section id="sidebar-second" class="sidebar clearfix"> <div class="region region-sidebar-second"> <section id="block-block-19" class="block block-block block-social-sidebar clearfix clearfix"> <div class="social-sidebar"> <div class="social-facebook social-sidebar-item"> <div> <i class="fa fa-facebook fa-2x"></i></div> <div> <strong><span>180K</span></strong><br /> fans</div> </div> <div class="social-twitter social-sidebar-item"> <div> <i class="fa fa-twitter fa-2x"></i></div> <div> <strong><span>120K</span></strong><br /> follower</div> </div> <div class="social-google-plus social-sidebar-item"> <div> <i class="fa fa-google-plus fa-2x"></i></div> <div> <strong><span>20K</span></strong><br /> in circle</div> </div> </div> </section> <!-- /.block --> <section id="block-views-forum-recent-topics-block" class="block block-views block-list clearfix clearfix"> <h2 class="block-title">Recent topics</h2> <div class="view view-forum-recent-topics view-id-forum_recent_topics view-display-id-block view-dom-id-d5f21f3d01501370d8cec57594e66f89"> <div class="view-content"> <div class="view view-news view-id-news view-display-id-block block-latest-news view-dom-id-736d39e58db901255c2870da043fa1a2"> <div class="view-content"><div class="container2"> <!-- Shoppingcart --> <div> <div class="nav-list"> <?php // // Show Shopping Cart // ?> <div id="BSCart" class="collections"> <div class="BSCart_list"> </div> </div> <?php // // Show Shopping Cart // ?> </div> </div> </div></div> </div> </section> <!-- /.block --> <section id="block-views-forum-recent-comments-block" class="block block-views block-list clearfix clearfix"> <h2 class="block-title">Commentaires récents</h2> <div class="view view-forum-recent-comments view-id-forum_recent_comments view-display-id-block view-dom-id-e08e638c7958a761806b5ca2e98860f7"> <div class="view-content"> <div class="item-list"> <ul> <li class="views-row views-row-1 views-row-odd views-row-first views-row-last"> <span class="views-field views-field-created"> <span class="field-content"><a href="/comment/15#comment-15">Quisque mattis neque in massa</a> - 07/22/2014 - 12:00</span> </span></li> </ul></div> </div>
si on fait un test de la page suivante sans passer par ajax il n'y a pas de probleme j'arrive a faire bouger ma case dans la page mais des lors que je clique sur le lien et que cette page est apeler par l'ajax cela ne fonctionne plus j'ai cherche dans tous les sens , c'est une catastrophe
merci a vous si vous avez une petite piste
Partager