Jump to content
MakeWebGames

AdamHull

Members
  • Posts

    443
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by AdamHull

  1. I think what kyle was trying to say in you need to change $_POST['id'] = abs((int) $_POST['id']); To $_POST['ID'] = abs((int) $_POST['ID']);
  2. Yes it should work
  3. We can not help you unless you provide code snippets
  4. May want to show us your code
  5. this is straight from their legal file
  6. If I can get hold off a copy of rc I will recode this to work
  7. Running this through a syntax checker I do not get any errors, you may want to run your code through a php beautifier (find on Google) as you seem to have a lot off white space which could be causing you issues. Also you do not need $h or $q__ry globalised ($h as it is a mccodes functions and $q__ry as you are setting this within the function)
  8. Update on your code?
  9. On line 7 your using $ir['playerid'] is it that? Of its not your code is going to fail.on line 7
  10. Do you use $ir In your other files to retrieve user info from database?
  11. You need to work on the design really bad, I have opened up the android app and webbrowser on my phone and it still has white on the bottom of you login
  12. You really need to add the code around [#code][/#code] with out the #
  13. You might need to add your stat array here so we can look at that aswell
  14. Go to that url and scroll down until you find edit post signature and attach the file
  15. You can not just change the file to mysqli you need to change the whole game to mysqli and the connection, I advise you read up a bit on mysqli and then when you have done your research then try again
  16. AdamHull

    Grpg faq

    Thanks, just in the process of making the base I started into using mysqli prepared statements, it is using a db class to make it easier to do but I will have to make a massive documentation on just the wrapper side of things
  17. AdamHull

    Grpg faq

    So after months of design changes I have chosen this one, what do you all think
  18. IT was on you isset Kyle you closed the ) right at the end of the line and missed the ; Just reread your post, guess you figured it out Kyle :p
  19. <?php /* * When you go live you may wish to remove this */ ini_set('display_errors',1); error_reporting(E_ALL); include "globals.php"; $spend = isset($_GET['spend']) ? $db->escape($_GET['spend']) : false; switch ($spend) { case 'brefill': braveRefill(); break; case 'refill': refillEnergy(); break; case 'IQ': buyIq(); break; case 'IQ2': buyIqSubmit(); break; case 'money': spendMoney(); break; case 'money2': spendMoneyConfirm(); break; default: index(); break; } function index() { global $ir, $set, $h; print "Welcome to the crystal temple!<br /> You have <b>". number_format($ir['crystals']) ."</b> crystals.<br /> What would you like to spend your crystals on?<br /> <br /> <a href='crystaltemple.php?spend=refill'>Energy Refill - {$set['ct_refillprice']} Crystals</a><br /> <a href='crystaltemple.php?spend=IQ'>IQ - {$set['ct_iqpercrys']} IQ per crystal</a><br /> <a href='crystaltemple.php?spend=money'>Money - \$".number_format($set['ct_moneypercrys'])." per crystal</a><br />"; $h->endpage(); return; } function braveRefill() { global $set, $db, $ir, $h; if($ir['crystals'] <$set['br_refillprice']) { print "You don't have enough crystals!"; $h->endpage(); return; } else if($ir['brave'] == $ir['maxbrave']) { print "You already have full energy."; $h->endpage(); return; } else { $db->query("UPDATE users SET brave=maxbrave,crystals=crystals-{$set['br_refillprice']} WHERE userid={$ir['userid']}"); echo "You have spent ". number_format($set['br_refillprice']) . "and filled up your brave"; $h->endpage(); return; } } function refillEnergy() { global $set, $db, $ir, $h; if($ir['crystals'] <$set['ct_refillprice']) { print "You don't have enough crystals!"; $h->endpage(); return; } else if($ir['energy'] == $ir['maxenergy']) { print "You already have full energy."; $h->endpage(); return; } else { $db->query("UPDATE users SET energy=maxenergy,crystals=crystals-{$set['ct_refillprice']} WHERE userid={$ir['userid']}"); print "You have paid ". number_format($set['ct_refillprice']) ."crystals to refill your energy bar."; $h->endpage(); return; } } function buyIq() { global $ir, $set, $h; print "Type in the amount of crystals you want to swap for IQ.<br /> You have <b>{$ir['crystals']}</b> crystals.<br /> One crystal = {$set['ct_iqpercrys']} IQ. <form action='crystaltemple.php?spend=IQ2' method='post'> <input type='text' name='crystals' /><br /> <input type='submit' value='Swap' /> </form>"; $h->endpage(); return; } function buyIqSubmit() { global $set, $db, $ir, $h; $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form.<br /> <a href='crystaltemple.php?spend=IQ'>Back</a>"; } else { $iqgain=$_POST['crystals']*$set['ct_iqpercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']} WHERE userid={$ir['userid']}"); $db->query("UPDATE userstats SET IQ=IQ+$iqgain WHERE userid={$ir['userid']}"); print "You traded {$_POST['crystals']} crystals for $iqgain IQ."; $h->endpage(); return; } } function spendMoney() { global $ir, $set, $h; print "Type in the amount of crystals you want to swap for money.<br /> You have <b>{$ir['crystals']}</b> crystals.<br /> One crystal = \$".number_format($set['ct_moneypercrys']).". <form action='crystaltemple.php?spend=money2' method='post'> <input type='text' name='crystals' /><br /> <input type='submit' value='Swap' /> </form>"; $h->endpage(); return; } function spendMoneyConfirm() { global $set, $db, $ir, $h; $_POST['crystals']=(int) $_POST['crystals']; if($_POST['crystals'] <= 0 || $_POST['crystals'] > $ir['crystals']) { print "Error, you either do not have enough crystals or did not fill out the form.<br /> <a href='crystaltemple.php?spend=money'>Back</a>"; } else { $iqgain=$_POST['crystals']*$set['ct_moneypercrys']; $db->query("UPDATE users SET crystals=crystals-{$_POST['crystals']},money=money+$iqgain WHERE userid={$ir['userid']}"); print "You traded {$_POST['crystals']} crystals for \$".number_format($iqgain)."."; } $h->endpage(); return; }   there you go
  20. Yes so did I, I pasted a p after one of the }
  21. ini_set('display_errors',1); error_reporting(E_ALL); Paste the above under your first line off code which will be
  22. Try this: http://pastebin.com/KbumiRXF
  23. Where are you querying $time['fj_time'] as this does not seem to be in your code
×
×
  • Create New...