Bonjour,
je n'arrive pas a trouver l'erreur renvoyé par le script ci-dessous.

Erreur : Parse error: syntax error, unexpected $end in /home/b/a/n/bankokash/www/convert.php on line 517

Le script concerné.

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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
 
 
<? 
session_start();
?>
<? include('header.php'); ?>
 
 
 
<body>
<center>
<h3>Convertir vos points en codes ou annonces.</h3>
<br>
<b><a href="/demandeannonce.php">Convertir en
annonces</a></b><br>
<span style="font-weight: bold;"><br>
<p><br>
 
<div align="center"><a href="convert.php?convert=ads"><b>Convertion en publicité</b></a><br>
 
Annoncez sur <? include('sitename.php'); ?>
 
<br><br>
 
</div>
 
<br><br>
 
<?
 
 
 
if ($_GET["convert"]=="cash")
 
{
 
echo "Tricheur ! Ton IP peut etre bannie ! Ne recommence pas ! Cheater ! Your IP could be ban ! Don't do it again !";
 
}
 
 
 
 
 
 
 
if ($_GET["convert"]=="ads")
 
{
 
 
 
$user=uc($_COOKIE["usNick"]);
 
 
 
	require('config.php'); 
 
$sql = "SELECT * FROM tb_users WHERE username='$user'";
 
$result = mysql_query($sql);        
 
$row = mysql_fetch_array($result);
 
 
 
$root=$row["money"];
 
 
 
$sqle = "SELECT * FROM tb_config WHERE item='hits' and howmany='1000'";
 
$resulte = mysql_query($sqle);        
 
$rowe = mysql_fetch_array($resulte);
 
mysql_close($con);
 
$pricee=$rowe["price"]; 
 
 
 
if ($root<$pricee){
 
echo "<center><b>Mince , vous avez seulement $".$row["money"]." Vous devriez au moins avoir $".$pricee." pour demander un paiement , patience .</b></center>";
 
}else{
 
 
 
echo "<center><b>Votre campagne sera acceptée vérification par notre équipe .</b></center>";
 
 
 
$email=$row["email"];
 
 
 
	require('config.php'); 
 
$checkuser = mysql_query("SELECT pemail FROM tb_advertisers WHERE pemail='$email'");
 
$username_exist = mysql_num_rows($checkuser);
 
mysql_close($con);
 
if ($username_exist>0) {
 
 
 
echo "<br><center><b>Votre convertion a été demandé , durée de la procédure : 1 à 2 jours .</b></center>";
 
 
 
}else{
 
 
 
 
 
 
 
if (isset($_POST["link"])) {
 
 
 
require('config.php');
 
 
 
 
 
if( strtolower($_POST['code'])!= strtolower($_SESSION['texto'])){ 
 
echo "Code de sécurité incorrect"; exit();
 
}
 
 
 
 
 
 
 
$link=limpiar($_POST["link"]);
 
$description=limpiar($_POST["description"]);
 
$category=$_POST["category"];
$pack=$_POST["pack"];
 
if ($link==""){echo "Erreur"; exit();}
 
if ($description==""){echo "Erreur"; exit();}
 
 
 
$laip = getRealIP();
 
 
 
$user=$_COOKIE["usNick"];
 
 
 
	require('config.php'); 
 
$sqlu = "SELECT * FROM tb_users WHERE username='$user'";
 
$resultu = mysql_query($sqlu);        
 
$rowu = mysql_fetch_array($resultu);
 
 
 
$money=$rowu["money"];
 
 
 
 
 
$query = "INSERT INTO tb_advertisers (pemail, plan, url, description, ip, tipo, money, category) VALUES('$user','$pack','$link','$description','$laip','convert','$money',$category)";
 
mysql_query($query) or die(mysql_error());
 
mysql_close($con);
 
echo "<br><center><b>Votre paiement a été demandé , durée de la procédure : 2 à 5 jours .</b></center>";
 
 
 
}else{
 
 
 
 
 
?>
 
<br><br>
 
<?
echo "<center>
Merci de completer le formulaire suivant</center>" ;
 
?>
 
 
 
<div align="center"><div id="form">
 
<fieldset><legend>&nbsp;Convertire en annonce&nbsp;</legend>
 
<form method="post" action="convert.php?convert=ads">
 
 
 
 
 
<table width="400" border="0" align="center">
 
  <tr>
 
    <td width="150" align="left"><p><label>Lien de la baniere</label></p></td>
 
    <td width="250" align="left"><input type="text" name="description" size="25" maxlength="100" autocomplete="off" class="field" value="" tabindex="1" /></td>
 
  </tr>
 
  <tr>
 
    <td width="150" align="left"><p><label>Lien du site</label></p></td>
 
    <td width="250" align="left"><input type="text" name="link" size="25" maxlength="150" autocomplete="off" class="field" value="http://" tabindex="1" /></td>
 
  </tr>
 
  <tr>
 
    <td width="150" align="left"><p><label>Catégorie</label></p></td>
 
    <td width="250" align="left"><select name="category" class="field" tabindex="2" />
<? 
// Script modifié par Goalfire
require ('config.php');
$tabla3 = mysql_query("SELECT * FROM tb_ads_categories ORDER BY id ASC"); 
while ($registro3 = mysql_fetch_array($tabla3)) {
$id=$registro3['id'];
echo "<option value=\"";
require ('config.php');
$sql = "SELECT * FROM tb_ads_categories WHERE id='$id'";
$result = mysql_query($sql);        
$row = mysql_fetch_array($result);
echo $row["id"];
echo "\">";
echo $row["catname"];
echo "</option>";
}; ?></select></td>
 
  </tr>
 
  <tr>
 
    <td width="150" align="left"><p><label>Pack</label></p></td>
 
    <td width="250" align="left"><select name="pack" class="field" tabindex="2" />
<? 
// Script modifié par Goalfire
require ('config.php');
$tabla4 = mysql_query("SELECT * FROM tb_config WHERE item='hits' ORDER BY price ASC"); 
while ($registro4 = mysql_fetch_array($tabla4)) {
$id=$registro4['id'];
echo "<option value=\"";
require ('config.php');
$sql2 = "SELECT * FROM tb_config WHERE item='hits' AND id='$id'";
$result2 = mysql_query($sql2);        
$row2 = mysql_fetch_array($result2);
echo $row2["howmany"];
echo "\">";
echo "".$row2["howmany"]." pour ".$row2["price"]." $";
echo "</option>";
}; ?></select></td>
 
  </tr>
 
  <tr>
 
    <td width="150" align="left"><p><label>Code de sécuritée </label></p></td>
 
    <td width="250" align="left"><input type='text' size='3' maxlength='3' name='code' autocomplete="off" class="securitycode" value="" tabindex="3" /></td>
 
  </tr>
 
  <tr>
 
    <td width="150" align="left">&nbsp;</td>
 
    <td width="250" align="left"><img src="image.php?<?php echo $res; ?>" /></td>
 
  </tr>
 
 
 
  <tr>
 
    <td width="150" align="left">&nbsp;</td>
 
    <td width="250" ><input type="submit" value="Convertire" class="submit" tabindex="4" /><br>
 
 
 
<? 
function get_ip(){ 
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ 
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];} 
elseif(isset($_SERVER['HTTP_CLIENT_IP'])){ 
$ip = $_SERVER['HTTP_CLIENT_IP'];} 
else{ $ip = $_SERVER['REMOTE_ADDR'];} 
return $ip;}$ip = get_ip();
?>
<b>Votre adresse ip sera conservée :</b>
<?
echo "$ip";
?>
 
 
 
 
 
 
 
	</td>
 
  </tr>
 
</table>
 
</form>
 
</fieldset>
 
</div></div></p>
<br>
<br>
</span><b><a href="/demandecode.php">Convertir
en codes</a><br>
<br>
<span style="text-decoration: underline;">Liste des codes
disponible en boutique et leurs valeur en points.<br>
<br>
</span><?php include('config.php'); $sql = 'SELECT howmany, price FROM tb_refset ORDER BY price DESC '; $result = mysql_query($sql) or die (mysql_error()); while ($row = mysql_fetch_array($result)) { echo htmlspecialchars($row['howmany']) . ' : ' . $row['price'] . ','; } ?>
<br>
<br>
<br>
<?
if (isset($_POST["customer"]))
{
 
$refset=$_POST["refset"];
 
 
 
require('config.php');
$queryx = mysql_query("SELECT sets FROM tb_buyref WHERE id='1' and refnum='$refset'") or die(mysql_error());
$rowx = mysql_fetch_array($queryx);
mysql_close($con);
if ($rowx["sets"]=="0")
{
echo "<font color=\"red\">Désolé , aucun pack n'est actuellement en vente.</font><br><br>";
}else{
 
 
// Si todo parece correcto procedemos con la inserccion
 
$setz=$rowx["sets"] - 1;
require('config.php');
$queryb = "UPDATE tb_buyref SET sets='$setz' WHERE id='1' and refnum='$refset'";
mysql_query($queryb) or die(mysql_error());
mysql_close($con);
 
$customer=limpiar($_POST["customer"]);
$pemail=limpiar($_POST["pemail"]);
$refset=limpiar($_POST["refset"]);
$precio=$_POST["price"];
$laip = getRealIP();
require('config.php');
//Todo parece correcto procedemos con la inserccion
$queryzz = "INSERT INTO tb_buyref (customer, amount, refset, pemail, ip) VALUES('$customer','1','$refset', '$pemail','$laip')";
mysql_query($queryzz) or die(mysql_error());
mysql_close($con);
 
?>
<br>
<p>Vote commande a été envoyée! <?
	require('config.php');
$sql = "SELECT * FROM tb_refset WHERE howmany='$refset'";
$result = mysql_query($sql);        
$row = mysql_fetch_array($result);
mysql_close($con);
$precio=$row["price"];
$description=$row["howmany"];
?>
 
 
</div>
</p>
<br>
<?
 
}
 
}else{
 
 
require('config.php');
$sqld = "SELECT * FROM tb_buyref WHERE customer='admin'";
$resultd = mysql_query($sqld);        
$rowd = mysql_fetch_array($resultd);
mysql_close($con);
?>
 
 
 
 
 
 
 
 
?>
</fieldset>
</div></div>
 
<br>
 
 
 
 
 
<?
 
$user=uc($_COOKIE["usNick"]);
require('config.php');
$sql = "SELECT * FROM tb_users WHERE username='$user'";
$result = mysql_query($sql);        
$row = mysql_fetch_array($result);
mysql_close($con);
?>
 
 
<div align="center"><div id="form">
<fieldset>
<legend>&nbsp;Commande&nbsp;</legend>
 
<form method="post" action="purchase.php">
 
<p>&nbsp;&nbsp;Client: <b><?= $row["username"] ?></b><input type="hidden" value="<?= $row["username"] ?>" name="customer"></p>
 
<p>&nbsp;&nbsp;Email: <b><?= $row["pemail"] ?></b><input type="hidden" value="<?= $row["pemail"] ?>" name="pemail"></p>
<p>&nbsp;&nbsp;Commande <b> 1 pack</b> de
 
 
<select name="refset" class="combo">
 
 
 
<?
require('config.php');
$tablaa = mysql_query("SELECT * FROM tb_refset ORDER BY id ASC"); // selecciono todos los registros de la tabla ads categories, ordenado por id
 
while ($registroa = mysql_fetch_array($tablaa)) { // comienza un bucle que leera todos los registros y ejecutara las ordenes que siguen
mysql_close($con);
 
echo "

<option value=\"".$registroa["howmany"] ."\">". $registroa["howmany"] ." Referals  - $". $registroa["price"] ." </option>

";
 
 
 
}
$refnum=$registroa["howmany"];
 
 
 
?>
 
</select></p>
 
<p><input type="submit" value="Payer" class="submit" tabindex="4" /></p>
 
<? 
function get_ip(){ 
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ 
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];} 
elseif(isset($_SERVER['HTTP_CLIENT_IP'])){ 
$ip = $_SERVER['HTTP_CLIENT_IP'];} 
else{ $ip = $_SERVER['REMOTE_ADDR'];} 
return $ip;}$ip = get_ip();
?>
<b>Votre adresse ip sera conservée :</b>
<?
echo "$ip";
?>
 
 
 
 
 
</form>
</fieldset>
</div></div>
<?
}
?>
 
 
 
<? include('footer.php'); ?>