Jump to content
MakeWebGames

Karlos

Members
  • Posts

    951
  • Joined

  • Last visited

    Never

Everything posted by Karlos

  1. Re: Secure Bank! [V2] soz about that -.-" i coded it this morning :)
  2. I Got Bored This Morning So I Made A More Secure Bank, MTG Also Helped Me Fix Up A Few Errors Replace bank.php with this <?php include (DIRNAME(__FILE__) . "/globals.php"); // Secured Up By Karlos // Helped By MTG To Fix A Few Errors print "<h3>Bank</h3>"; if($ir['bankmoney']>-1) { $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : ""; switch($_GET['action']) { case "deposit": deposit(); break; case "withdraw": withdraw(); break; default: index(); break; } } else { if(isset($_GET['buy'])) { if($ir['money']>4999) { print "Congratulations, you bought a bank account for \$5,000! [url='bank.php']Start using my account[/url]"; $sql = sprintf("UPDATE users SET money = money - %u WHERE (userid = %u)", 5000, $userid); $db->query($sql); } else { print "You do not have enough money to open an account. [url='explore.php']Back to town...[/url]"; } } else { print "Open a bank account today, just \$5,000! [url='bank.php?buy']> Yes, sign me up![/url]"; } } function index() { global $db, $ir, $c, $userid, $h; echo sprintf("[b]You currently have \$%s in the bank.[/b] ", number_format($ir['bankmoney'])); echo ("<table width='85%' cellspacing=1 class='table'>"); echo ("<tr>"); echo ("<td width='50%'>[b]Deposit money[/b] "); echo ("It will cost you 15% of the money you deposit, rounded up. The maximum fee is \$3,000.<form action='bank.php?action=deposit' method='post'>"); echo sprintf("Amount: <input type='text' name='deposit' value='%s' /> ", $ir['bankmoney']); echo ("<input type='submit' value='Deposit' /></form></td>"); echo ("<td width='50%'>[b]Withdraw money[/b] "); echo ("There is no fee on withdrawals.<form action='bank.php?action=withdraw' method='post'>"); echo sprintf("Amount: <input type='text' name='withdraw' value='%s' /> ", $ir['bankmoney']); echo ("<input type='submit' value='Withdraw' /></form></td>"); echo ("</tr>"); echo ("</table>"); } function deposit() { global $db,$ir,$c,$userid,$h; $_POST['deposit'] = (float) $_POST['deposit']; if($_POST['deposit'] > $ir['money']) { print "You do not have enough money to deposit this amount."; } else { $fee=ceil($_POST['deposit']*15/100); if($fee > 3000) { $fee=3000; } $gain=$_POST['deposit']-$fee; $ir['money']+=$gain; $sql = sprintf("UPDATE users SET bankmoney = bankmoney + %u, money = money - %u WHERE (userid = %u)", @intval($gain), $_POST['deposit'], $userid); $db->query($sql); echo sprintf("You hand over \$%s to be deposited, after the fee is taken (\$%s), \$%s is added to your account. [b]You now have \$%s in the bank.[/b] [url='bank.php']> Back[/url]", number_format($_POST['deposit']), number_format($fee), number_format($gain), number_format($ir['bankmoney'])); } function withdraw() { global $db,$ir,$c,$userid,$h; $_POST['withdraw'] = (float) $_POST['withdraw']; if($_POST['withdraw'] > $ir['bankmoney']) { print "You do not have enough banked money to withdraw this amount."; } else { $_POST['withdraw'] = (float) $_POST['withdraw']; $gain=$_POST['withdraw']; $ir['bankmoney']-=$gain; $sql = sprintf("UPDATE users SET bankmoney = bankmoney - %u, money = money + %u WHERE (userid = %u)", $gain, $gain, $userid); $db->query($sql); echo sprintf("You ask to withdraw %s, the banking lady grudgingly hands it over. [b]You now have \$%s in the bank.[/b] [url='bank.php']> Back[/url]", number_format($gain), number_format($ir['bankmoney'])); } } } $h->endpage(); ?> CODE UPDATED
  3. Re: need free mc lite mods ever used a search box for the site? :|
  4. Re: contact staff [v2] well i got bored and i made a staff mailbox and this would send the mail to the staff mailbox and it had an option to reply back and it would end up in the normal mailbox :-) so i also use $ir['new_staffmail'] now
  5. Re: contact staff [v2] i just realised that the mailbox wont go Mailbox (1) beacuse theres no part to make it do it so try this   call it cstaff.php <?php include "globals.php"; if($_POST['go']) { $to = (int) $_POST['staff']; $_POST['text'] = strip_tags($_POST['text']); $msg = str_replace(array("\n"),array(" "),htmlentities($_POST['text'])); $db->query("INSERT INTO mail VALUES ('',0,$userid,$to,unix_timestamp(),'Staff contact form','$msg')") or die($db->error()); $db->query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$to}"); print "Your mail to the selected staff member has been sent. Please allow 24 hours for a response to be returned. Thank You. "; } else { $q=$db->query("SELECT * FROM users WHERE user_level > 1 ORDER BY user_level"); print "[b]Contact Staff[/b] <form action='cstaff.php' method='post'> Staff Member: <select name='staff'>"; while($z=$db->fetch_row($q)) { print "<option value='{$z['userid']}'>{$z['username']}</option>"; } print "</select> Message to staff member: <textarea name='text' rows='7' cols='40'>Send a mail to the selected staff member</textarea> <input type='hidden' name='go' value='true'> <input type='submit' value='Send' /> </form>"; } $h->endpage(); ?>
  6. Re: [FREE] [V2] 2 Game Styles/Themes :-D
  7. Re: Updated Personal Details [V2] ive tested this and it says that they dont want to share the personal info when they do..... :|
  8. Re: [FREE] [V2] 2 Game Styles/Themes   That would be a secret ;) (I cannot even remember ill try and find it later) Okay :) Its A Good Font :-P
  9. Re: [FREE] [V2] 2 Game Styles/Themes oh well :-D off topic at iamwicked: what font is that you use in you sig?
  10. Re: Staff Applications [FREE] thats the sql table.....
  11. Re: Bodyguard - My first attempt to make my first mod   Trust You :-P :-P ~ ImMorTaL X ~ i got two words for you the last one is you and the first begins with f lol get back to me when you figure it out I Think I Got It You F****r :-P Did You? :-D
  12. Re: Bug Reports {V2}   i agree They Have A Good Point..... But Still Give Him The Credit For Trying ~ImMorTaL X ~
  13. Re: Staff Applications [FREE] Nice One Zero ~ ImMorTaL X ~
  14. Re: Bodyguard - My first attempt to make my first mod   Trust You :-P :-P ~ ImMorTaL X ~
  15. Re: Bodyguard - My first attempt to make my first mod no problem :-) nice mod tho :-D
  16. Re: Bodyguard - My first attempt to make my first mod I Know You Mean In attack.php But Some People Dont :| Nice One Tho :wink:
  17. Re: Bodyguard - My first attempt to make my first mod   Find It Where? :roll:
  18. Re: Bug Reports {V2} Screenshot? Always Nice :wink:
  19. Re: BRAND NEW EXPLORE [v2] Tested   i use Dogpiles
  20. Re: BRAND NEW EXPLORE [v2] Tested   i thought so, so there could be copyright issues :|   Thats the point, the main use for the image is a template. make a tutorial then
  21. Re: BRAND NEW EXPLORE [v2] Tested   i still cant find this image.... are you sure you didnt find it via google?   everyone else has a right to knw if its fine to use the image for free? dont you think? not really as i doubt anyone will be using this! or maybe im wrong :| you never knw but they deserve to know
  22. Re: BRAND NEW EXPLORE [v2] Tested   everyone else has a right to knw if its fine to use the image for free? dont you think?
  23. Re: BRAND NEW EXPLORE [v2] Tested     it took ages finding the pic and i don't bookmark every page i go on so if you want to prove it YOU go find it   so u didnt find it on the site for free :|
  24. Re: BRAND NEW EXPLORE [v2] Tested that image u used can u provide me with the link of where you found it?
  25. Re: BRAND NEW EXPLORE [v2] Tested ive just been on http://www.thesimpsons.com/index.html and i see no free section :|
×
×
  • Create New...