Jump to content
MakeWebGames

Recommended Posts

Posted

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.

screenshot1.png

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....

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...