AlabamaHit Posted October 26, 2008 Posted October 26, 2008 check this code out..... if($ir['crybank'] > -1) { switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['crystals'] >= 250) { print " Congratulations, you bought a crystal reserve account for 250 crystals! [url='crybank.php']Start using my account[/url]"; $open = sprintf("UPDATE users SET crystals = crystals - %d, crybank = %d WHERE userid = %d ", @intval(250), @intval(0), @intval($userid)); mysql_query($open); } else { print " You do not have enough crystals to open an account. [url='explore.php']Back to town...[/url]"; } } else { print " Open a crystal reserve account today, just 250 Crystals! [url='crybank.php?buy']> Yes, sign me up![/url]"; } } It looks like it should work. But what it is doing is. Even if you have No account.....it is trying to run that query...and taking me and saying i dont have enough crystals...(This is because I dont have enough out...) This is what I'm seeing....and in the Database my crybank is set to -1. I should be seeing it asking to buy it... NOTE: Also If you have enough crystals out.....It shows the right page...It ask if you want to buy it....then.....if youjust refresh the page it takes the crystals and takes you in the bank.......you dont have to click the link.... Quote
radio_active Posted October 26, 2008 Posted October 26, 2008 Re: Something wierd i found messing around need help with. I believe that is because you have to 'else's right after eachother so its pulling the first else which just happens to be that one. So if you look at the bank.php and compare you will find your problem. Quote
AlabamaHit Posted October 26, 2008 Author Posted October 26, 2008 Re: Something wierd i found messing around need help with. Well i complared it...and basically this page is just a modified page of it....but if you mean moving the print " Open a crystal reserve account today, just 250 Crystals! [url='crybank.php?buy']> Yes, sign me up![/url]"; To the beginnig... I have tried that before posting here. No luck with it...I thought the same.... Its pretty wierd aint it, lol I found the problem... at the top of the page..i added $_GET['buy'] = abs((int) $_GET['buy']); That was making the page think i was already in "Buy" mode i guess... I removed that and works now.. Just thought i would post this to let eveyone know. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.