Jump to content

Gregoyle

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by Gregoyle

  1. For some reason when people Buy Pokeballs it does not subtract the amount of money they have spent, I was wondering if anybody could tell me why Normally i would get the coder to look into it but hes gone for a week. I know the script is gonna look stupid but thats cause i removed some parts that aren't needed to tell me whats wrong so nobody can just use this. if(isSet($_POST['submit']) && $_POST['submit'] == 'Buy Pokeballs') { $stones = array_filter($_POST['ball']); foreach($stones AS $name=>$amount) { $doQuery = mysql_query("SELECT * FROM `poke_balls` WHERE `name_caps` = '$name' LIMIT 1"); if(mysql_num_rows($doQuery)) { $result = mysql_fetch_assoc($doQuery); if($result['stock'] < $amount) { $_SESSION['error'] = 'The shop doesn\'t have that many '.$name.'\'s in stock.'; header('Location: pokeball_shop.php'); exit; } else { $uName = preg_replace('/[^a-z]/','',strtolower($name)); $userQuery = mysql_fetch_assoc(mysql_query("SELECT `$uName` FROM `users` WHERE `id` = $user->id LIMIT 1")); $totalCost = $totalCost+($amount*$result['price']); $queryShop[] = "UPDATE `poke_balls` SET `stock` = ".($result['stock']-$amount)." WHERE `name`='".$name."'"; $queryUser[] = '`'.$uName.'` = '.($userQuery[$uName]+$amount).''; } } else { $_SESSION['error'] = 'You cannot buy pokeballs that don\'t exist.'; header('Location: pokeball_shop.php'); exit; } } if(count($stones) <= 0) { $_SESSION['error'] = 'You must select some pokeballs to buy.'; header('Location: pokeball_shop.php'); exit; } if($totalCost > $user->gold) { $_SESSION['error'] = 'You don\'t have enough gold to complete this purchase.'; header('Location: pokeball_shop.php'); exit; } else { foreach($queryShop AS $query) { mysql_query($query); } $newGold = $user->gold - $totalCost; $doUserquery = mysql_query("UPDATE `users` SET gold=".$newGold." , ".implode(' , ',$queryUser)." WHERE id = $user->id LIMIT 1"); $_SESSION['success'] = 'You have successfully purchased these pokeballs.'; header('Location: pokeball_shop.php'); exit; } } include('left_menu.php'); ?> <script type="text/javascript"> <!-- function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function updateTotal() { var stoneCount = ((document.getElementById('shopTable').rows.length)-3); var totalAmount = 0; for(i=1; i<=stoneCount; i++) { thisPrice = document.getElementById('shopTable').rows[i].cells[1].innerHTML.replace(/[^0-9]/g,''); thisAmount = document.getElementById('shopTable').rows[i].cells[3].childNodes[1].value.replace(/[^0-9]/g,''); document.getElementById('shopTable').rows[i].cells[3].childNodes[1].value=thisAmount; totalAmount = totalAmount+(thisAmount*thisPrice); } if(totalAmount > <?=$user->gold;?>) { document.getElementById('cost').innerHTML='<span style="color:#990000;">$'+addCommas(totalAmount)+'</span>'; } else { document.getElementById('cost').innerHTML='<span style="color:#009900;">$'+addCommas(totalAmount)+'</span>'; } } //--> </script> ?> <form action="pokeball_shop.php" method="POST"> <table cellpadding="0" cellspacing="1" border="0" style="background:#000; margin: 10px auto;" id="shopTable"> <tr> <td class="listHead"> Pokeball </td> <td class="listHead"> Price </td> <td class="listHead"> Stock </td> <td class="listHead"> Buy </td> </tr> <?PHP $doQuery = mysql_query("SELECT * FROM `poke_balls` ORDER BY `cost` ASC"); <tr> <td colspan="3" class="totalCost"> Total Cost: </td> <td id="cost" class="cost"> $0 </td> </tr> <tr> <td colspan="4" class="formButton"> <input type="submit" name="submit" value="Buy Pokeballs" class="button" > <input onClick="document.getElementById('cost').innerHTML='$0';" type="reset" value="Clear" class="button" > </td> </tr> </table> </form> </div> <?PHP include ("right_menu.php");?>
  2. Hey, I have a minigame on my website and when you bet 1 It says you lost and you lose your point but it doesn't remove it, Same with if you win it says you gain the point but doesn't add it.... function bet ($bet){ sleep(2); $user1 = mysql_query("SELECT * FROM `users` WHERE `id`='" . $_SESSION['id'] . "'"); $user = mysql_fetch_object($user1); $chance = rand (1, 2); $bet = round ($bet); $betPretty = number_format ($bet); if ($bet == 0) { $echo = "You did not bet anything!"; $chance = 0; } if ($bet < 0) { $echo = "You cannot bet a negative number."; $chance = 0; } if ($bet > $user->minigame_points) { $echo = "This is more minigame points than you have!"; $chance = 0; } if ($user->minigame_points == 0) { $echo = "You do not have any minigame points."; $chance = 0; } if ($chance == 1) { //Win $money = $user->minigame_points+$bet; $times_bet = $user->times_bet+1; mysql_query ("UPDATE `users` SET `minigame_points`='" . $money . "', `times_bet`='" . $new_bet . "' WHERE `username`='" . $user->username . "'"); $money = number_format($money); $echo = "You won $betPretty minigame points!<br /><b>Current Minigame Points:</b> $money"; } if ($chance == 2) { //Lose $money = $user->minigame_points-$bet; $times_bet = $user->times_bet+1; mysql_query ("UPDATE `users` SET `minigame_points`='" . $money . "', `times_bet`='" . $new_bet . "' WHERE `username`='" . $user->username . "'"); $money = number_format($money); $echo = "You lost $bet minigame points.<br /><b>Current Minigame Points:</b> $money"; } return $echo;
  3. Wow cant edit my original post? Never mind i figured it out. its cause i did: backgroundcolor: green; And not background-color: green;
  4. Goooooood Morning. (lol 11pm <3) Alright so I'm editing the CSS for my website (tpk-rpg.net) And i want the background image to stretch from corner to corner but seeing as that's not possible for FF/IE yet i thought "Why not have the background one colour and just center an image on top of it!" Well i know how to center the image body { background-image:url('background.png'); background-repeat:no-repeat; background-attachment:fixed; background-position:center; } But how do i set a background colour so it appears BEHIND the image....?
  5. Never mind i figured it out, Only thanks to you fine people. Thanks alot. ~Greg~
  6. Fortunately that fixed half of the issue, Why only half? Cause it opened another one Now when i run $traderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='{$trading->username}' AND `traded`='0' ORDER BY `name` ASC"); It doesn't display my list anymore, Just the other persons list (It does EXACTLY what i wanted just cant see my list anymore) So basically for the other persons list its like this $traderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='{$trading->username}' AND `traded`='0' ORDER BY `name` ASC"); And the list maker <td class="w50"><p class="center"><?=$trading->username?>'s Pokémon<br /><select name="othertrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($tradert=mysql_fetch_object($traderss1)){?><option value="<?=$tradert->id?>"><?=$tradert->name?> <?=$tradert->gender?> (Level:<?=$tradert->level?>)</option><?}?></select></p></td></table> And for my list (As you can see i had to re-instate the old code :\ $owntraderss2=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" . $user->username . "' ORDER BY `name` ASC"); <form action="/trade5.php?a=<?=$_GET['q']?>" method="POST"><table class="w100"><tr><td class="w50"><p class="center">Your Pokémon<br /><select name="mytrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($owntradert=mysql_fetch_object($owntraderss2)){?><option value="<?=$owntradert->id?>"><?=$owntradert->name?> <?=$owntradert->gender?> (Level:<?=$owntradert->level?>)</option><?}?></select></p></td> So is there any way to make it where BOTH lists can use the same thing?
  7. This is what i have $traderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" . $trading->username . "' ORDER BY `name` ASC"); How can i do this: $traderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" AND `traded`='0' . $trading->username . "' ORDER BY `name` ASC"); I know its not as simple as just adding AND `traded`='0' cause i tried that and i just got this Parse error: syntax error, unexpected '=' in /home/tpkrpgn1/public_html/trade5.php on line 57 MySQL table (in case you need to know it?) (`id`, `trainer`, `gender`, `name`, `party1`, `party2`, `party3`, `party4`, `party5`, `party6`, `level`, `exp`, `hp`, `totalhp`, `att`, `def`, `box`, `days`, `battle_wins`, `battle_losses`, `move1`, `move2`, `move3`, `move4`, `attbon`, `defbon`, `totalexp`, `sold`, `traded`, `item`, `soldtrainer`)
  8. Its in PHPMyAdmin, i don't know if its MySQL or just SQL? or are those the same thing? o.o I assume you mean this? (`id`, `trainer`, `gender`, `name`, `party1`, `party2`, `party3`, `party4`, `party5`, `party6`, `level`, `exp`, `hp`, `totalhp`, `att`, `def`, `box`, `days`, `battle_wins`, `battle_losses`, `move1`, `move2`, `move3`, `move4`, `attbon`, `defbon`, `totalexp`, `sold`, `traded`, `item`, `soldtrainer`) Its not the whole Male/Female thing i was using that as an example since i wasn't sure if i used Pokemon people would understand it. Basically what I'm trying to do is make it where if traded=1 the Pokemon doesn't appear on the list at all. This is the code that makes up the list <div class="contentcontent"><p class="title"><center>Trade pokemon with trainer #<?=$_GET['q']?></p></center> <form action="/trade5.php?a=<?=$_GET['q']?>" method="POST"><table class="w100"><tr><td class="w50"><p class="center">Your Pokémon<br /><select name="mytrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($owntradert=mysql_fetch_object($owntraderss1)){?><option value="<?=$owntradert->id?>"><?=$owntradert->name?> <?=$owntradert->gender?> (Level:<?=$owntradert->level?>)</option><?}?></select></p></td> <td class="w50"><p class="center"><?=$trading->username?>'s Pokémon<br /><select name="othertrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($tradert=mysql_fetch_object($traderss1)){?><option value="<?=$tradert->id?>"><?=$tradert->name?> <?=$tradert->gender?> (Level:<?=$tradert->level?>)</option><?}?></select></p></td></table> This is the WHOLE php file <?php session_start(); require_once 'dbconf.php'; include("figg.php"); if(!isset($_SESSION['user'])){ ?> <script language="text/javascript"> alert('You are not logged in.'); </script><? header ("Location: login.php"); } else{ session_start(); $snorretje1 = mysql_query("SELECT * FROM `users` WHERE `username`='" . $_SESSION['user'] . "'"); $snorretje = mysql_fetch_object($snorretje1); $user1 = mysql_query("SELECT * FROM `users` WHERE `id`='$snorretje->id'"); $user = mysql_fetch_object($user1); require_once 'figg.php'; $pokemon1 = mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='$user->username' AND `party1`='1'"); $sex = mysql_query("SELECT * FROM `poke_owned` WHERE `traded`='1'"); $pokemon = mysql_fetch_object($pokemon1); $poke1 = mysql_query("SELECT * FROM `pokemon` WHERE `name`='$pokemon->name'"); $poke = mysql_fetch_object($poke1); $amo1= mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='$user->username'"); $amo=mysql_num_rows($amo1); $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['q'] . "'"); $trading=mysql_fetch_object($trading1); $traderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" . $trading->username . "' ORDER BY `name` ASC"); $traderss=mysql_fetch_object($traderss1); $owntraderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" . $user->username . "' ORDER BY `name` ASC"); ?> <?include("leftmenu.php");?> <?if($_GET['q']==""){?> <div class="title">Trade pokemon</div> <div class="contentcontent"> <br> <center> <?if(!isset($_POST['mytrade'])){ if(!isset($_POST['othertrade'])){?> Please enter the number of the trainer you would like to trade with:<br> <br> <form name="form" action="trade5.php" method="get"> <input type="text" name="q" /> <input type="submit" name="Submit" value="Trade" class="button" /> </form> <?}}}?> <?if($_GET['q']!=""){ if ($user->id == $_GET['q']) { echo "<div class=\"contentcontent\"><p class=\"title\">Trade pokemon</p><br><center>You can't trade yourself... Silly buns...</center></div>"; include("rightmenu.php"); exit; } $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['q'] . "'"); $trading=mysql_fetch_object($trading1); $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['q'] . "'"); $num=mysql_num_rows($trading1); if($num==0){echo("<center><b>No user found with that ID.</b></center>");} if($num==1){ ?> <div class="contentcontent"><p class="title"><center>Trade pokemon with trainer #<?=$_GET['q']?></p></center> <form action="/trade5.php?a=<?=$_GET['q']?>" method="POST"><table class="w100"><tr><td class="w50"><p class="center">Your Pokémon<br /><select name="mytrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($owntradert=mysql_fetch_object($owntraderss1)){?><option value="<?=$owntradert->id?>"><?=$owntradert->name?> <?=$owntradert->gender?> (Level:<?=$owntradert->level?>)</option><?}?></select></p></td> <td class="w50"><p class="center"><?=$trading->username?>'s Pokémon<br /><select name="othertrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($tradert=mysql_fetch_object($traderss1)){?><option value="<?=$tradert->id?>"><?=$tradert->name?> <?=$tradert->gender?> (Level:<?=$tradert->level?>)</option><?}?></select></p></td></table> <center><input type="submit" value="Trade"> <?}} $bs=2; if ($bs == 1) { ?> ' <? } if(isset($_POST[mytrade])){ { $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['a'] . "'"); $trading=mysql_fetch_object($trading1); $id1=mysql_query("SELECT * FROM `trade`"); $id=mysql_fetch_object($id1); $numbl=mysql_num_rows($id1); if($numbl==0) { $tradeid=0; } else { $tradeid=$id->tradeid+1; } $ytrade=$_POST[mytrade]; if($ytrade){ foreach ($ytrade as $y) mysql_query("INSERT INTO `trade` (`from`, `to`, `pokid`,`tradeid`,`owner`) values('" . $user->id . "','" . $_GET['a'] . "','" . $y . "','" . $tradeid . "','" . $user->id . "')")or die(mysql_error()); $theother1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['a'] . "'"); $theother=mysql_fetch_object($theother1); $error1=mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='" . $theother->username . "' AND `id`='" . $y . "' OR `trainer`='" . $user->username . "' AND `id`='" . $y . "'"); $error=mysql_num_rows($error1); if($error==0 && $y!=niks) { echo("Don't try to cheat!"); exit; } } if($ytrade){ foreach ($ytrade as $y) mysql_query("UPDATE poke_owned SET traded=1 WHERE id='" . $y . "'"); mysql_query("DELETE FROM `trade` WHERE `pokid`='niks'"); } { } } $otrade=$_POST[othertrade]; if($otrade){ foreach ($otrade as $o) mysql_query("INSERT INTO `trade` (`from`, `to`, `pokid`,`tradeid`, `owner`) values('" . $user->id . "','" . $_GET['a'] . "','" . $o . "','" . $tradeid . "','" . $_GET['a'] . "')")or die(mysql_error()); $theother1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['a'] . "'"); $theother=mysql_fetch_object($theother1); $error1=mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='" . $theother->username . "' AND `id`='" . $o . "' OR `trainer`='" . $user->username . "' AND `id`='" . $y . "'"); $error=mysql_num_rows($error1); if($error==0 && $o!=niks) { echo("Don't try to cheat!"); exit; } } if($otrade){ foreach ($otrade as $o) mysql_query("UPDATE poke_owned SET traded=1 WHERE id='" . $o . "'"); mysql_query("DELETE FROM `trade` WHERE `pokid`='niks'"); } unset($_POST[mytrade]); unset($_POST[othertrade]); ?><meta http-equiv="Refresh" content="0; url=/traded.php"><? } ?> <br> <p> </p> <p class="center"> </p> </div> <?include("rightmenu.php");?> </html> <?}?>
  9. They are in a SQL Database This is what i have been trying to do but i don't understand how....
  10. Say i wanted to make a list with only female names and i wrote the whole file for it but it kept showing both Male and Female names how would i remove the male names from the list without deleting them out of the SQL? I wish i knew how to word this better for what I'm looking for.... ----------------------------------------------Don't know if you need this---------------------------------------------- MySQL Server: Localhost via UNIX socket Server version: 5.0.91 Protocol version: 10 User: tpkrpgn1@localhost MySQL charset: UTF-8 Unicode (utf8) Web server cpsrvd 11.28.64 MySQL client version: 5.0.91 PHP extension: mysql phpMyAdmin Version information: 3.3.8.1 ----------------------------------------------Don't know if you need this---------------------------------------------- Also is there a way to delete previous posts?
  11. Alright first off, I don't know if this is a PHP or SQL problem. Second, I am not very knowledgeable in this subject at all the only reason I'm trying to get this to work is cause my buddy's computer is broken so he can't do much of anything (Would let him use mine but he lives half way across the country from me). So jumping right to the point we purchased this website about a month back cause it was going downhill and we thought this would be a great base to start from. So the following PHP script IS NOT written by us. Since i cant paste the script without it being a wall of text I'll have to tell you the issue BEFORE i post it. When you create the trade for example: Your Oddish His Squirtle It shows that but when you make ANOTHER separate trade for example: Your Lugia His Ho-Oh <-------------That's how it SHOULD look but it goes like this instead: Your Oddish Lugia His Squirtle Ho-Oh Now when you make the trade it adds into the SQL "traded" 1 instead of 0 so i was wondering if from the list of available Pokemon for trade if i could just have any Pokemon that has "Traded" as 1 to be removed from the list BUT NOT FROM THE GAME! Lol i tried DELETE FROM `poke_owned` WHERE `traded`='1' And lets just say that it didn't turn out well.... Now i don't know how much information your going to need so if you need more than just the trade script tell me. <?php session_start(); require_once 'dbconf.php'; include("figg.php"); if(!isset($_SESSION['user'])){ ?> <script language="text/javascript"> alert('You are not logged in.'); </script><? header ("Location: login.php"); } else{ session_start(); $snorretje1 = mysql_query("SELECT * FROM `users` WHERE `username`='" . $_SESSION['user'] . "'"); $snorretje = mysql_fetch_object($snorretje1); $user1 = mysql_query("SELECT * FROM `users` WHERE `id`='$snorretje->id'"); $user = mysql_fetch_object($user1); require_once 'figg.php'; $pokemon1 = mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='$user->username' AND `party1`='1'"); $pokemon = mysql_fetch_object($pokemon1); $poke1 = mysql_query("SELECT * FROM `pokemon` WHERE `name`='$pokemon->name'"); $poke = mysql_fetch_object($poke1); $amo1= mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='$user->username'"); $amo=mysql_num_rows($amo1); $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['q'] . "'"); $trading=mysql_fetch_object($trading1); $traderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" . $trading->username . "' ORDER BY `name` ASC"); $traderss=mysql_fetch_object($traderss1); $owntraderss1=mysql_query("SELECT * FROM `poke_owned` WHERE `box`='1' AND `trainer`='" . $user->username . "' ORDER BY `name` ASC"); $owntraderss=mysql_fetch_object($owntraderss1); $nummer=mysql_num_rows($traderss1); ?> <?include("leftmenu.php");?> <?if($_GET['q']==""){?> <div class="title">Trade pokemon</div> <div class="contentcontent"> <br> <center> <?if(!isset($_POST['mytrade'])){ if(!isset($_POST['othertrade'])){?> Please enter the number of the trainer you would like to trade with:<br> <br> <form name="form" action="trade5.php" method="get"> <input type="text" name="q" /> <input type="submit" name="Submit" value="Trade" class="button" /> </form> <?}}}?> <?if($_GET['q']!=""){ if ($user->id == $_GET['q']) { echo "<div class=\"contentcontent\"><p class=\"title\">Trade pokemon</p><br><center>You can't trade yourself... Silly buns...</center></div>"; include("rightmenu.php"); exit; } $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['q'] . "'"); $trading=mysql_fetch_object($trading1); $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['q'] . "'"); $num=mysql_num_rows($trading1); if($num==0){echo("<center><b>No user found with that ID.</b></center>");} if($num==1){ ?> <div class="contentcontent"><p class="title">Trade pokemon with trainer #<?=$_GET['q']?></p> <form action="/trade5.php?a=<?=$_GET['q']?>" method="POST"><table class="w100"><tr><td class="w50"><p class="center">Your Pokémon<br /><select name="mytrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($owntradert=mysql_fetch_object($owntraderss1)){?><option value="<?=$owntradert->id?>"><?=$owntradert->name?> <?=$owntradert->gender?> (Level:<?=$owntradert->level?>)</option><?}?></select></p></td> <td class="w50"><p class="center"><?=$trading->username?>'s Pokémon<br /><select name="othertrade[]" multiple="multiple" size="20"><option value="niks" selected>(No Pok&#233;mon)</option><?while($tradert=mysql_fetch_object($traderss1)){?><option value="<?=$tradert->id?>"><?=$tradert->name?> <?=$tradert->gender?> (Level:<?=$tradert->level?>)</option><?}?></select></p></td></table> <center><input type="submit" value="Trade"> <?}} $bs=2; if ($bs == 1) { ?> ' <? } if(isset($_POST[mytrade])){ { $trading1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['a'] . "'"); $trading=mysql_fetch_object($trading1); $id1=mysql_query("SELECT * FROM `trade`"); $id=mysql_fetch_object($id1); $numbl=mysql_num_rows($id1); if($numbl==0) { $tradeid=0; } else { $tradeid=$id->tradeid+1; } $ytrade=$_POST[mytrade]; if($ytrade){ foreach ($ytrade as $y) mysql_query("INSERT INTO `trade` (`from`, `to`, `pokid`,`tradeid`,`owner`) values('" . $user->id . "','" . $_GET['a'] . "','" . $y . "','" . $tradeid . "','" . $user->id . "')")or die(mysql_error()); $theother1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['a'] . "'"); $theother=mysql_fetch_object($theother1); $error1=mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='" . $theother->username . "' AND `id`='" . $y . "' OR `trainer`='" . $user->username . "' AND `id`='" . $y . "'"); $error=mysql_num_rows($error1); if($error==0 && $y!=niks) { echo("Don't try to cheat!"); exit; } } if($ytrade){ foreach ($ytrade as $y) mysql_query("UPDATE poke_owned SET traded=1 WHERE id='" . $y . "'"); mysql_query("DELETE FROM `trade` WHERE `pokid`='niks'"); } { } } $otrade=$_POST[othertrade]; if($otrade){ foreach ($otrade as $o) mysql_query("INSERT INTO `trade` (`from`, `to`, `pokid`,`tradeid`, `owner`) values('" . $user->id . "','" . $_GET['a'] . "','" . $o . "','" . $tradeid . "','" . $_GET['a'] . "')")or die(mysql_error()); $theother1=mysql_query("SELECT * FROM `users` WHERE `id`='" . $_GET['a'] . "'"); $theother=mysql_fetch_object($theother1); $error1=mysql_query("SELECT * FROM `poke_owned` WHERE `trainer`='" . $theother->username . "' AND `id`='" . $o . "' OR `trainer`='" . $user->username . "' AND `id`='" . $y . "'"); $error=mysql_num_rows($error1); if($error==0 && $o!=niks) { echo("Don't try to cheat!"); exit; } } if($otrade){ foreach ($otrade as $o) mysql_query("UPDATE poke_owned SET traded=1 WHERE id='" . $o . "'"); mysql_query("DELETE FROM `trade` WHERE `pokid`='niks'"); } unset($_POST[mytrade]); unset($_POST[othertrade]); ?><meta http-equiv="Refresh" content="0; url=/traded.php"><? } ?> <br> <p> </p> <p class="center"> </p> </div> <?include("rightmenu.php");?> </html> <?}?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.