PDA

View Full Version : making a bank?


trojanbobba
11-07-2002, 02:32 PM
ok well im trying to make a bank for a online game but i dont have a idea on making one i know it be summit like bank - credits credits + bank but im not sure

basicly i want it to transfer the amount of credits that he put in the input box into the bank but if he doesnt have enough credits it will tell them that he doesnt have enough got any ideas ?:confused:

Socraties
11-08-2002, 08:42 PM
you could try something like this:

<?
if ($credits < $item_wanted){
print "You don't have enough credits\n";
}else
$total_credits_left = $items_wanted - $credits;
print "You have $credits left, Thank you for your purchase";
}
?>

That is just a way to get the calculation you would need. you may want to do some type of casting to ensureyou are working with just straight numbers and not characters. But that is all you really need to do to check the amount of credits.

Hope this helps you some.