Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Problem] podwojony zakup
geralt55
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 16.11.2011

Ostrzeżenie: (0%)
-----


Witam. Mam taki oto problem. Jeżeli kupie przedmiot przez formularz to na serwerze ukazuje się on x2. Nie mogę dojść czemu tak się dzieję. Skrypt nie jest mój tylko by Hannik.

Oto kod:
  1. <div id="content"> <div class="postui2 text-title">
  2. <h2>
  3. Zakup
  4.  
  5. </h2>
  6.  
  7. </div>
  8. <div class="postui2 text-con">
  9. <div class="con-wrap">
  10. <?PHP
  11.  
  12. if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
  13.  
  14. if(isset($_GET['id']) && checkInt($_GET['id'])) {
  15.  
  16. $sqlCmd="SELECT vnum, preis, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2 FROM ".SQL_HP_DB.".is_items WHERE id='".$_GET['id']."' LIMIT 1";
  17. $sqlQry=mysql_query($sqlCmd,$sqlHp);
  18. if(mysql_num_rows($sqlQry)==1) {
  19.  
  20. $getItem=mysql_fetch_object($sqlQry);
  21. if($_SESSION['user_coins']>=$getItem->preis) {
  22.  
  23. $getGroesse = compareItems($getItem->vnum);
  24. $belPos = checkPos($_SESSION['user_id']);
  25. $possiblePos = findPos($belPos['islager'],$getGroesse['groesse']);
  26. if(!empty($possiblePos)) {
  27.  
  28. $sqlCmd="UPDATE account.account SET coins=coins-".$getItem->preis." WHERE id='".$_SESSION['user_id']."' LIMIT 1";
  29. $sqlQry=mysql_query($sqlCmd,$sqlServ);
  30. $sqlLog="INSERT INTO ".SQL_HP_DB.".is_log (account_id,vnum,preis,zeitpunkt) VALUES ('".$_SESSION['user_id']."','".$getItem->vnum."','".$getItem->preis."','".$sqlZeit."')";
  31. $qryLog=mysql_query($sqlLog,$sqlHp);
  32. $sqlItem="INSERT INTO player.item
  33. (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)
  34. VALUES
  35. ('".$_SESSION['user_id']."','MALL','".$possiblePos[0]."','1','".$getItem->vnum."','".$getItem->attrtype0."', '".$getItem->attrvalue0."', '".$getItem->attrtype1."', '".$getItem->attrvalue1."', '".$getItem->attrtype2."', '".$getItem->attrvalue2."', '".$getItem->attrtype3."', '".$getItem->attrvalue3."', '".$getItem->attrtype4."', '".$getItem->attrvalue4."', '".$getItem->attrtype5."', '".$getItem->attrvalue5."', '".$getItem->attrtype6."', '".$getItem->attrvalue6."', '".$getItem->socket0."', '".$getItem->socket1."', '".$getItem->socket2."')";
  36. $qryItem=mysql_query($sqlItem,$sqlServ) or die(mysql_error());
  37. echo'<p class="meldung">Przedmiot zostal pomyslnie zakupiony, jezeli nie pojawi sie w magazynie IS skontaktuj sie niezwlocznie z administratorem.</p>';
  38.  
  39. }
  40. else {
  41. echo'<p>Nie masz wystarczajaco duzo miejsca w magazynie IS.</p>';
  42. }
  43.  
  44. }
  45. else {
  46. echo'<p class="meldung">Nie masz wystarczajaco monet.</p>';
  47. }
  48. }
  49. else {
  50. echo'<p class="meldung">Element nie istnieje.</p>';
  51. }
  52. }
  53. else {
  54. echo'<p class="meldung">Tutaj wpisz poprawny ID</p>';
  55. }
  56. echo'<p><a href="java script:history.back()">zur&uuml;ck</a></p>';
  57. }
  58. else {
  59. echo'<p class="meldung">Musisz byc zalogowany na tym obszarze.</p>';
  60. }
  61. ?>
  62. </div>
  63.  
  64. </div>
  65. <div class="postui2 text-end">
  66.  
  67.  
  68.  
  69. </div></div>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 15:00