Dayo Posted January 20, 2010 Share Posted January 20, 2010 Here is a bank for your games, there ios no sql as the tables already exist. Enjoy :D to edit the percentage just cange $bperc at the top if you dont want to charge intrest make it 0 <?php include 'top.php'; // Bank Script Made By Dayo // Made for the GL scripts $bperc = 3; // set this to the ammount you want to charge to deposit money // dont forget to make a link on your menu [url='bank.php']Bank[/url] if (isset($_POST['withdraw'])) { $withdraw = abs(@intval($_POST['withdraw'])); if ($withdraw > $bank_money) { echo 'You dont have enough money in your bank to do this';} else { mysql_query("UPDATE `login` SET `money`=`money`+'".$withdraw."', `bank`=`bank`-'".$withdraw."'"); echo 'You withdrew $'.number_format($withdraw).' from your bank.';} } else if (isset($_POST['deposit'])) { $ibp = 100 - $bperc; $deposit = abs(@intval($_POST['deposit'])); $depo=round($deposit/100); $deposit2 = $depo*$ibp; if ($deposit > $money) { echo 'You dont have enough money to do this';} else { mysql_query("UPDATE `login` SET `money`=`money`-'".$deposit."', `bank`=`bank`+'".$deposit2."'"); echo mysql_error(); echo 'You deposited $'.number_format($deposit).' into your bank.';} } ?> <form name="form1" method="post" action=""> <?php if ($_GET['action']=='deposit') { echo '[[url="bank.php?action=withdraw"]Withdraw Money[/url]] [Deposit Money]'; } else if ($_GET['action'] == 'withdraw') { echo '[Withdraw Money] [[url="bank.php?action=deposit"]Deposit Money[/url]]';}?> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2">[b]Bank[/b]</td> </tr> <?php if ($bperc > 0) {?> <tr> <td colspan="2">There is a charge of <?php echo $bperc; ?>% to deposit your money</td> </tr> <?php }// ends $bperc if statment?> <?php if ($_GET['action']=='withdraw') {?> <tr> <td>Withdraw</td> <td><label> <input name="withdraw" type="text" id="withdraw" value="<?php echo round($bank_money); ?>"> </label></td> </tr><?php } else if ($_GET['action']=='deposit') {?> <tr> <td>Deposit</td> <td><label> <input name="deposit" type="text" id="deposit" value="<?php echo $money; ?>"> </label></td> </tr><?php } if (!isset($_GET['action'])) { echo '<tr><td>[url="bank.php?action=withdraw"]Withdraw Money[/url]</td><td>[url="bank.php?action=deposit"]Deposit Money[/url]</td></tr>';} else {?> <tr> <td colspan="2"><label> <input type="submit" name="Submit" value="Submit"> </label></td> </tr><?php } ?> </table> </form> <?php include 'bottom.php'; ?> if you have any problems post here Quote Link to comment Share on other sites More sharing options...
Zero-Affect Posted January 22, 2010 Share Posted January 22, 2010 just my own personally specification but would $withdraw = abs(@intval($_POST['withdraw'])); not be better being $withdraw = ( ctype_digit($_POST['withdraw']) AND isset($_POST['withdraw']) ) ? $_POST['withdraw'] : 'FALSE' ; or something along them lines? Quote Link to comment Share on other sites More sharing options...
scott142 Posted July 21, 2010 Share Posted July 21, 2010 help no form on the swiss bank page so i can't withdraw money or deposit money please help. Quote Link to comment Share on other sites More sharing options...
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.