Bonjour à toutes et tous,
Alors voilà mon souci j'ai acheté un script de vente sur internet et maintenant que j'ai un souci, la personne qui me l'a vendue ne réponds plus ! Le bonheur quoi...
Le problème de renvoi de formulaire est assez récurent j'ai vu par ci par là des réponses, mais je n'ai pas les connaissances suffisantes pour le faire moi même...
Il s'agit en fait d'un paiement effectué par paypal tous se passe bien jusqu'au retour sur mon site.
Après recherche, paypal renvoi des données sur mon site, données qui disent que le paiement a bien été effectué ou pas, et ces données renvoi aussi un nombre de crédits qui va donc être "crédité" sur le compte du client.
Jusque là tout se passe bien quand les données sont renvoyées de paypal sur mon site, il affiche bien si le paiement est bien effectué et le client est crédité SAUF QUE si le client actualise cette fameuse page de mon site le paiement n'est pas refait mais le compte est crédité à chaque actualisation, ou même dès que le client à payer et qu'il arrive sur cette page et qu'il clique pour aller sur une autre page du site, dès qu'il part de cette page il est crédité une nouvelle fois...!!!
Donc voilà tout mon problème, il faudrait juste je sais qu'il y ait une condition en plus genre si paiement "completed" et "compte crédité" alors on ne recrédite pas le compte.
Un truc tout con mais que je ne sais pas du tout comment faire...
Si quelqu'un pouvait m'aider ce serait génial !!!
Ci-dessous je vous met le code de la page de réception qui confirme le paiement et crédite le compte.


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
 
 
 
<?php
/*
//$amount = $HTTP_POST_VARS['amount'];
//$email = $HTTP_POST_VARS['email'];
$payment_status = $HTTP_POST_VARS['x_relay_response'];
$option = $HTTP_POST_VARS['option'];
$order_id = $HTTP_POST_VARS['oid'];
//$payment_status = "TRUE";
*/
 
//$amount = $HTTP_POST_VARS['amount'];
//$email = $HTTP_POST_VARS['email'];
$option = $_GET['option'];
if($option=='A')
	$payment_status = $HTTP_POST_VARS['x_relay_response'];
else
	$payment_status = $HTTP_POST_VARS['payment_status'];	
$oid = $_GET['id'];
$paytype = $_GET['paytype'];
//$payment_status = "TRUE";
//$payment_status = "Completed";
//$option="A";
$qry="select * from account where md5(order_id)='$oid'";
$qryResult=$dbh->query($qry);
$Data=mysql_fetch_object($qryResult);
if($Data->item_id==0)
{
if($option=='A')
	{	
		$pay_title=$lang['anet'].' '.$lang['conf'];
		if($payment_status =="TRUE")
			{
			$dbh->query("update account set paystatus='TRUE', approved='Y' where md5(order_id)='$oid'");
 
			   $qry11="select credit from credit_cost where id='$Data->bid_cost'";
			   $qryResult11=$dbh->query($qry11);
			   $Data11=mysql_fetch_object($qryResult11);	
 
			   $qry1="select * from users where user_id='$Data->user_id'";
			   $qryResult1=$dbh->query($qry1);
			   $Data1=mysql_fetch_object($qryResult1);
 
			   $qry2="select amount from amount_transfer where user_id='$Data->user_id' and credit_type='C' and reason like '%Welcome Coupon%'";
			   $qryResult2=$dbh->query($qry2);
			   $Data2=mysql_fetch_object($qryResult2);
 
			   if($Data1->balance==$Data2->amount)
			   {
			 $tbalance=$Data1->balance + $Data11->credit + $First_purchase_bid;
			 $dbh->query("insert into amount_transfer (user_id, entrydate, amount, amount_type, pay_type, reason) values('$Data1->user_id', '$CURRENT_Time', '$First_purchase_bid','P', 'Credit', 'Free bid on First Bid Purchasing')");
			 }
			   else
			   {
		 $tbalance=$Data1->balance + $Data11->credit;
 
		  $dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason) values('$Data1->user_id', '$CURRENT_Time', '$Data11->credit', 'Credit', 'Bid Purchasing')");
			  }
 
 
			   $sql2="update users set balance='$tbalance' where user_id='$Data1->user_id'";
			   $result=$dbh->query($sql2);
			   $sql3="update account set transfer_status='TRUE' where order_id='$Data->order_id'";
			   $result=$dbh->query($sql3);
				$credit=$Data11->credit;	 
 
				$Email_info=$functions->Email_info(12);
				$subject=$Email_info['subject'];
 
				$msgBody=$Email_info["message"];
 
				eval("\$msgBody = \"$msgBody\";");
 
				$functions->Send_mail($SITE_EMAIL,$SITE_TITLE,$Data1->email,$subject,$msgBody);
 
 
			$heading=$lang['msg_bid_rec_success'].' '.$lang['anet'].'.';
			}
		else
			{
			$heading=$lang['msg_bid_rec_fail'];
			$retry='<td align="center"><input type="submit" value="'.$lang['retry'].'" name="retry"></td>';
			$retry_page='index.php?show=bid_tickets';
			}
}
else if($option=='P')
	{	
		$pay_title=$lang['paypal'].' '.$lang['conf'];
		if($payment_status =="Completed")
			{
 
			$dbh->query("update account set paystatus='TRUE', approved='Y' where md5(order_id)='$oid'");
 
		 $qry="select * from account where md5(order_id)='$oid'";
			$qryResult=$dbh->query($qry);
			$Data=mysql_fetch_object($qryResult);
 
		  $qry11="select credit from credit_cost where id='$Data->bid_cost'";
			   $qryResult11=$dbh->query($qry11);
			   $Data11=mysql_fetch_object($qryResult11);	
 
			 $qry1="select * from users where user_id='$Data->user_id'";
			   $qryResult1=$dbh->query($qry1);
			   $Data1=mysql_fetch_object($qryResult1);
 
				$qry2="select amount from amount_transfer where user_id='$Data->user_id' and credit_type='C' and reason like '%Welcome Coupon%'";
			   $qryResult2=$dbh->query($qry2);
			   $Data2=mysql_fetch_object($qryResult2);
 
			   if($Data1->balance==$Data2->amount)
			   {
			 $tbalance=$Data1->balance + $Data11->credit + $First_purchase_bid;
			 $dbh->query("insert into amount_transfer (user_id, entrydate, amount, amount_type, pay_type, reason) values('$Data1->user_id', '$CURRENT_Time', '$First_purchase_bid','P', 'Credit', 'Free bid on First Bid Purchasing')");
			 }
			   else
			   {
		 $tbalance=$Data1->balance + $Data11->credit;
 
		  $dbh->query("insert into amount_transfer (user_id, entrydate, amount, pay_type, reason) values('$Data1->user_id', '$CURRENT_Time', '$Data11->credit', 'Credit', 'Bid Purchasing')");
			  }
 
			 $sql2="update users set balance='$tbalance' where user_id='$Data1->user_id'";
			   $result=$dbh->query($sql2);
 
				 $sql3="update account set transfer_status='TRUE' where order_id='$Data->order_id'";
			   $result=$dbh->query($sql3);
			 $credit=$Data11->credit;	
 
			$Email_info=$functions->Email_info(12);
			$subject=$Email_info['subject'];
			 $msgBody1=$Email_info["message"];
 
			 $msgBody=str_replace("\\", "", $msgBody1);
			eval("\$msgBody = \"$msgBody\";");
 
				$functions->Send_mail($SITE_EMAIL,$SITE_TITLE,$Data1->email,$subject,$msgBody);
 
 
			$heading=$lang['msg_bid_rec_success'].' '.$lang['paypal'];
			}
		else
			{
			$heading=$lang['msg_bid_rec_fail'];
			$retry='<td align="center"><input type="submit" value="'.$lang['retry'].'" name="retry"></td>';
			$retry_page='index.php?show=bid_tickets';
			}
}
		$sql="select a.*, u.email from account as a left join users as u on u.user_id=a.user_id where md5(a.order_id)='$oid'";
	$sqlResult=$dbh->query($sql);
	$sqlRow=mysql_fetch_object($sqlResult);
 
	 $qry11="select credit from credit_cost where id='$sqlRow->bid_cost'";
	 $qryResult11=$dbh->query($qry11);
	 $Data11=mysql_fetch_object($qryResult11);
	$credit=$Data11->credit;
 
	$Email_info=$functions->Email_info(22);
			$subject=$Email_info['subject'];
 
			$msgBody=$Email_info["message"];
			eval("\$msgBody = \"$msgBody\";");
 
			$functions->Send_mail($SITE_EMAIL,$SITE_TITLE,$Data1->email,$subject,$msgBody);
 
 
	$message3='<p>'.$email.$lang['msg_pur_bid_tik_success'].'</p>
	<br />
	'.$lang['bid_pur'].': '.$Data11->credit.'';
 
	if($option=='A')
		$subject3=$lang['anet'].' '.$lang['payment'].' '.$lang['conf'];
	if($option=='P')
		$subject3=$lang['paypal'].' '.$lang['payment'].' '.$lang['conf'];
 
	$functions->Send_mail($email,"Purchase Bid Tickets",$SITE_EMAIL,$subject3,$message3);
}
else
{
$qry="select * from bid where id='$Data->item_id' and status='Y' and deleted='N' and end_bid!='Y'"; 
$qryResult1=$dbh->query($qry);
if(@mysql_num_rows($qryResult1)==0)
{
$Data1=mysql_fetch_object($qryResult1);
 
 if($option=='A')
	{	
		$pay_title=$lang['anet'].' '.$lang['conf'];
		if($payment_status =="TRUE")
			{
			$dbh->query("update account set paystatus='TRUE', approved='Y' where md5(order_id)='$oid'");
 
			$dbh->query("update bid set mark_flag='Y' where id='$Data->item_id' and start='Y'");
 
			$heading=$lang['msg_bid_rec_success'].' '.$lang['anet'].'.';
			}
		else
			{
			$heading=$lang['msg_bid_rec_fail'];
			$retry='<td align="center"><input type="submit" value="'.$lang['retry'].'" name="retry"></td>';
			$retry_page='index.php?show=view_pay_details&pay_id=$Data->item_id';
			}
	}
	else if($option=='P')
	{
		$pay_title=$lang['paypal'].' '.$lang['conf'];
		if($payment_status =="Completed")
			{
			$dbh->query("update account set paystatus='TRUE', approved='Y' where md5(order_id)='$oid'");
 
		   $dbh->query("update bid set mark_flag='Y' where id='$Data->item_id' and start='Y'");
 
			$heading=$lang['msg_bid_rec_success'].' '.$lang['paypal'];
 
 
			}
		else
			{
			$heading=$lang['msg_bid_rec_fail'];
			$retry='<td align="center"><input type="submit" value="'.$lang['retry'].'" name="retry"></td>';
			$retry_page='index.php?show=view_pay_details&pay_id=$Data->item_id';
			}
	}
 
}
else
{
	$current_time=date('Y-m-d', $CURRENT_TIME);
 
	$res=$dbh->query("select * from general_setting");
	$row=mysql_fetch_object($res);
	$SITE_EMAIL=stripslashes($row->site_email);
 
	if($option=='A')
		$paytype="TRUE";
	else if($option=='P')
		$paytype="Completed";
 
	if($payment_status == $paytype)
	{
			$pay_title=$lang['paypal'].' '.$lang['conf'];
 
 			$dbh->query("update account set paystatus='TRUE', approved='Y' where md5(order_id)='$oid'");
 
			$sql="SELECT id FROM bid WHERE deleted='N' and status='Y' and start='Y' and end_bid='N' and auction_type='P' and id='$Data->item_id'";
			$res=$dbh->query($sql);
			$Data3=@mysql_fetch_object($res);
 
		 	$Qry="select amount, user_id from account where item_id='$Data3->id' order by id desc";
			$Res=$dbh->query($Qry);
			$Data1=@mysql_fetch_object($Res);
			$block_user=$functions->Get_Block_User($Data1->user_id);
 
			if($block_user==0)
			{
 
			$Qry1="select email from users where deleted='N' and status='Y' and user_id='$Data1->user_id'";
			$Res1=$dbh->query($Qry1);
			$Data2=@mysql_fetch_object($Res1);
 
			$dbh->query("update bid set mark_flag='Y',end_bid='Y',end_time='".$END_Time."' where id='$Data3->id' and start='Y'");
 
			$dbh->query("insert into winners (bid_id,user_id,price,entrydate) values('$Data3->id','$Data1->user_id','$Data1->amount','$CURRENT_Time')");
 
				//$message1='<p>'.$lang['u_won'].' '.$lang['wewillbeback'].'</p>';
				//$subject1=$lang['u_won'];
 
				$Email_info=$functions->Email_info(15);
				$subject1=$Email_info['subject'];
				$message1=$Email_info["message"];
				eval("\$message1 = \"$message1\";");	
 
				$MSG_body='<html><body>
							<table  cellspacing="0" cellpadding="0" width="97%" border="0" align="center">
								<tr><td>'.$message1.'</td></tr>
							</table></body></html>';
 
				$mail = new PHPMailer();
 
				$mail->From  = $SITE_EMAIL;						//site url of sender 
				$mail->FromName = $SITE_TITLE;					//site title of sender
				$mail->AddAddress($Data2->email);				// email address of reciever
				$mail->WordWrap = 50;                           // set word wrap
				$mail->IsHTML(true);                            // send as HTML
				$mail->Subject  =  $subject1;					// subject of mail
				$mail->Body     =  $MSG_body;					// body of mail
 
				$mail->Send();
 
				/*
				$sqlResult1=$dbh->query("select U.email from users as U, my_setting as M where U.deleted='N' and U.user_id=M.user_id and M.auction_result='Y'");
				while($sqlRow1=mysql_fetch_object($sqlResult1))
				{
				$message1='<p>'.$lang['auc_fin'].'</p>';
				$subject1=$lang['auc_res'];
					
				$mail = new PHPMailer();
							
				$mail->From  = $SITE_EMAIL;						//site url of sender 
				$mail->FromName = $SITE_TITLE;					//site title of sender
				$mail->AddAddress($sqlRow1->email);				// email address of reciever
				$mail->WordWrap = 50;                           // set word wrap
				$mail->IsHTML(true);                            // send as HTML
				$mail->Subject  =  $subject1;					// subject of mail
				$mail->Body     =  $message1;					// body of mail
							
				$mail->Send();
				}
				*/
 
				//***********************************//
 
			$Qry11="select * from bid where id='$Data->item_id'";
			$Res11=$dbh->query($Qry11);
			$Data11=@mysql_fetch_object($Res11);
 
			$today = $CURRENT_Time; 
			$quantity_stock=($Data11->quantity_stock)-1;
			$auction_code=$functions->Get_auto_auction_code();
			$current_date=$CURRENT_DATE;
			$current_time=$CURRENT_TIME;
			$uploaddir = "bid_images/";
 
			if($Data11->parent_auction!=0)
			$Qry11="select * from bid where parent_auction='$Data11->parent_auction' and date( entrydate ) = '$current_date'";
			else
			$Qry11="select * from bid where parent_auction='$Data->item_id' and date( entrydate ) = '$current_date'";
 
			$Res11=$dbh->query($Qry11);
			$frequency_run=@mysql_num_rows($Res11);
 
 
			//$frequency_run=$functions->get_used_frequency($today_start,$today_end,$Data->item_id);
 
			$Date_array=explode("-",$Data11->edate);
			$Time_array=explode(":",$Data11->end_auction);
			$Final_End_time=mktime($Time_array[0], $Time_array[1],$Time_array[2], $Date_array[1], $Date_array[2], $Date_array[0]);
			$Start_Date_array=explode("-",$Data11->sdate);
			$Start_Time_array=explode(":",$Data11->start_auction);
			$Start_Final_End_time=mktime($Start_Time_array[0], $Start_Time_array[1],$Start_Time_array[2], $Start_Date_array[1], $Start_Date_array[2], $Start_Date_array[0]);
			$Final_end_time=$current_time+($Final_End_time-$Start_Final_End_time);	
			$new_date_time=date("Y-m-d H:i:s",$Final_end_time);
			$new_pieces=explode(" ",$new_date_time);
 
			if($frequency_run<=$Data11->max_frequency || $Data11->max_frequency=='-1')
			{
			if($quantity_stock!='-1')
				{
 
				$temppath=$uploaddir."/".$Data11->image_path;
 
				$last=substr(strrchr($Data11->image_path,"."),0);
				$last1=$last;
				$last1=ltrim($last1,'.');
				$file1=$CURRENT_TIME;
				$filename0=$file1.$last;
 
				$image_path = $uploaddir.$filename0;
 
 
				$indexcontent=@file_get_contents($temppath);		
				$functions->get_copy_pictures($indexcontent,$image_path);
 
				$new_name1=explode('.',$image_path);
				$functions->get_water_image("bid_images/".$image_path,"bid_images/",$new_name1[0]);
 
				$temppath_2=$uploaddir."/".$Data11->image_path2;
 
				$last_2=substr(strrchr($Data11->image_path2,"."),0);
				$last1_2=$last_2;
				$last1_2=ltrim($last1_2,'.');
				$file1_2=$CURRENT_TIME;
				$filename0_2=$file1_2.'_2'.$last_2;
 
				$image_path_2 = $uploaddir.$filename0_2;
 
				$indexcontent_2=@file_get_contents($temppath_2);		
				$functions->get_copy_pictures($indexcontent_2,$image_path_2);
 
				$new_name2=explode('.',$image_path_2);
				$functions->get_water_image("bid_images/".$image_path_2,"bid_images/",$new_name2[0]);
 
				$temppath_3=$uploaddir."/".$Data11->image_path3;
 
				$last_3=substr(strrchr($Data11->image_path3,"."),0);
				$last1_3=$last_3;
				$last1_3=ltrim($last1_3,'.');
				$file1_3=$CURRENT_TIME;
				$filename0_3=$file1_3.'_3'.$last_3;
 
				$image_path_3 = $uploaddir.$filename0_3;
 
				$indexcontent_3=@file_get_contents($temppath_3);		
				$functions->get_copy_pictures($indexcontent_3,$image_path_3);
 
				$new_name3=explode('.',$image_path_3);
				$functions->get_water_image("bid_images/".$image_path_3,"bid_images/",$new_name3[0]);
 
				$temppath_4=$uploaddir."/".$Data11->image_path4;
 
				$last_4=substr(strrchr($Data11->image_path4,"."),0);
				$last1_4=$last_4;
				$last1_4=ltrim($last1_4,'.');
				$file1_4=$CURRENT_TIME;
				$filename0_4=$file1_4.'_4'.$last_4;
 
				$image_path_4 = $uploaddir.$filename0_4;
 
				$indexcontent_4=@file_get_contents($temppath_4);		
				$functions->get_copy_pictures($indexcontent_4,$image_path_4);
 
				$new_name4=explode('.',$image_path_4);
				$functions->get_water_image("bid_images/".$image_path_4,"bid_images/",$new_name4[0]);
 
				if($Data11->parent_auction!=0)
				{
					$Qry12="select parent_auction from bid where id='$Data->item_id'";
					$Res12=$dbh->query($Qry12);
					$Data12=@mysql_fetch_object($Res12);
 
					$parent_auction=$Data12->parent_auction;
				}
				else
					$parent_auction=$Data->item_id;
 
				$new_date=$CURRENT_DATE;
				$new_enddate=$new_pieces[0];
				$update_date="DATE_ADD('$new_date', INTERVAL 1 DAY)";
				$update_enddate="DATE_ADD('$new_enddate', INTERVAL 1 DAY)";
				$des1=addslashes($Data11->des);
				$title1=addslashes($Data11->title);
				$short_description=addslashes($Data11->short_description);
				if($frequency_run==($Data11->max_frequency-1))
				$sql="insert into bid (title, lang, bid_rate, des, image_path2, image_path,image_path3,image_path4, entrydate, auction_code, extends_time, final_bid, start_auction, end_auction, normal_rate, category, start_pause, sdate, edate, timer_value, delivery_cost, delivery_info, meta_description, meta_keyword, auction_type, start_price, system_id, target_price, robot_system, robot_runtime, quantity_stock, max_frequency, beginner_auction, short_description, parent_auction, sequenceid) values('$title1', '$Data11->lang',
			'$Data11->bid_rate', '$des1', '$filename0_2', '$filename0','$filename0_3','$filename0_4', '$today','$auction_code', '$Data11->extends_time', '$Data11->start_price' , '".$Today_Time."', '$new_pieces[1]', '$Data11->normal_rate', '$Data11->category', '$Data11->start_pause', $update_date, $update_enddate, '$Data11->timer_value', '$Data11->delivery_cost', '$Data11->delivery_info', '$Data11->meta_description', '$Data11->meta_keyword', '$Data11->auction_type', '$Data11->start_price', '$Data11->system_id', '$Data11->target_price', '$Data11->robot_system', '$Data11->robot_runtime', '$quantity_stock', '$Data11->max_frequency', '$Data11->beginner_auction', '$short_description', '$parent_auction', $Data11->sequenceid)";
				else
				$sql="insert into bid (title, lang, bid_rate, des, image_path2, image_path,image_path3,image_path4, entrydate, auction_code, extends_time, final_bid, start_auction, end_auction, normal_rate, category, start_pause, sdate, edate, timer_value, delivery_cost, delivery_info, meta_description, meta_keyword, auction_type, start_price, system_id, target_price, robot_system, robot_runtime, quantity_stock, max_frequency, beginner_auction, short_description, parent_auction, sequenceid) values('$title1', '$Data11->lang',
			'$Data11->bid_rate', '$des1', '$filename0_2', '$filename0','$filename0_3','$filename0_4', '$today','$auction_code', '$Data11->extends_time', '$Data11->start_price' , '".$Today_Time."', '$new_pieces[1]', '$Data11->normal_rate', '$Data11->category', '$Data11->start_pause', '".$CURRENT_DATE."', '$new_pieces[0]', '$Data11->timer_value', '$Data11->delivery_cost', '$Data11->delivery_info', '$Data11->meta_description', '$Data11->meta_keyword', '$Data11->auction_type', '$Data11->start_price', '$Data11->system_id', '$Data11->target_price', '$Data11->robot_system', '$Data11->robot_runtime', '$quantity_stock', '$Data11->max_frequency', '$Data11->beginner_auction', '$short_description', '$parent_auction', $Data11->sequenceid)";
 
				$result=$dbh->query($sql);
 
				if($result){
					$seq=mysql_insert_id();
					$dbh->query("update bid set sequence='$seq' where id='$seq'");
 
					$qry3="select * from bid_details where status='Y' and deleted='N' and item_id='$parent_auction'";
					$qry2=$dbh->query($qry3);
						while($result2=mysql_fetch_object($qry2))
						{
						$qryi3="insert into bid_details (title,description,delivery_info,short_description,lang,item_id) values('$result2->title','$result2->description','$result2->delivery_info','$result2->short_description','$result2->lang','$seq')";  
						$result5=$dbh->query($qryi3);
						}
					}
				}
			else
				{
					$subject1='out of stock';
					$message1=$Data11->title.$lang['stock_currently'];
 
					$mail = new PHPMailer();
 
					$mail->From  = $SITE_EMAIL;						//site url of sender 
					$mail->FromName = $SITE_TITLE;					//site title of sender
					$mail->AddAddress($SITE_EMAIL);					// email address of reciever
					$mail->WordWrap = 50;                           // set word wrap
					$mail->IsHTML(true);                            // send as HTML
					$mail->Subject  =  $subject1;					// subject of mail
					$mail->Body     =  $message1;					// body of mail
 
					$mail->Send();
				}
			}
 
				//***********************************//
 
				$heading=$lang['msg_bid_rec_success'].' '.$lang['paypal'];	
				}
				else
				$heading=$lang['block_user'];
				}			
			else
				{
				$heading=$lang['msg_bid_rec_fail'];
				$retry='<td align="center"><input type="submit" value="'.$lang[retry].'" name="retry"></td>';
				$retry_page='index.php?show=view_buy_details&item_id=$Data->item_id';
				}
}
}
 
?>
Donc voilà si quelqu'un pouvait me rajouter cette fameuse condition pour éviter le problème de "recréditation" ou m'expliquer comment faire (mais alors en détails car je n'y connais pas grand chose...) bin ça serait le bonheur !!

Merci d'avance et bonne année à tout le monde !!!