-
Posts
2,140 -
Joined
-
Last visited
-
Days Won
148
Content Type
Profiles
Forums
Events
Everything posted by Magictallguy
-
You must spread some Reputation around before giving it to sniko again. Sorry sniks :P
-
[In Prod.] Enhanced Registration
Magictallguy replied to KyleMassacre's topic in Requests & In Production
Ugh, MD5.. Other than the obvious flaw with using MD5, your system is decent. I like it :) To battle the MD5 flaw, I'd do something like this: ALTER TABLE `users` ADD `newpass` ENUM('yes','no') NOT NULL DEFAULT 'no', CHANGE `userpass` `userpass` TEXT NOT NULL; Then run a select upon the authenticate (which it does, you'll just need to add in `newpass`) function mtgCrypt($pass) { return crypt($pass, '$6$rounds=5000$someSaltHard_CodedIn$'); } if((md5($_POST['password']) == $r['userpass'] AND $r['newpass'] == 'no') OR (mtgCrypt($_POST['password']) == $r['userpass'] AND $r['newpass'] == 'yes')) { // Correct details entered. Update the user's password to the new system. if($r['newpass'] == 'no') $db->query("UPDATE `users` SET `userpass` = '".mtgCrypt($_POST['password'])."', `newpass` = 'yes' WHERE `userid` = ".$r['userid']); // Handle the rest of the login $_SESSION['userid'] = $r['userid']; $_SESSION['loggedin'] = true; header("Location: loggedin.php"); exit; } else { // Login failed. Send them back to login.php with details as to why or handle it here } Using something like this system is how I've managed to convert multiple games using MD5 into something (currently) irreversible. Try it, and see what happens ;) -
If it's max table size then .. get a better host! If that's not an option, then write a backup query that handles overspill from the original table and creates/inserts into the new table automatically. If it's database size, then create another database designed specifically for handling the player transaction logs! If it's both, then combine the methods
-
Quite right! Though, a collab for idea sharing might not be a bad idea ;) Skype's on my profile :) You'll be storing a lot of information. Why not use the database for what it was intended? Information storage! My transaction log uses 1 table, is currently full of around 64,000 rows and working through it to get the information I need is 1 quick query. Using a txt file isn't, in my opinion, a route *anyone* should take if they have database capabilities
-
I've moved it around a little. That may be more to your liking
-
The only I've left in hrefs to the viewuser.php and gang.php is because you may have set up something that allows guests to view limited information about player profiles and gang descriptions respectively... <?php session_start(); include(__DIR__ . '/config.php'); global $_CONFIG; define("MONO_ON", 1); include(__DIR__ . '/class/class_db_'.$_CONFIG['driver'].'.php'); $db = new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; $set = array(); $settq = $db->query("SELECT * FROM settings"); while($r = $db->fetch_row($settq)) $set[$r['conf_name']] = stripslashes(htmlspecialchars($r['conf_value'])); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo $set['game_name'];?></title> <script language="JavaScript"> <!-- function getCookieVal(offset) { var endstr = document.cookie.indexOf(";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function GetCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal(j); i = document.cookie.indexOf(" ", i) + 1; if (i === 0) break; } return null; } function SetCookie(name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function DeleteCookie(name, path, domain) { if (GetCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } // --> var usr; var pw; var sv; function getme() { usr = document.login.username; pw = document.login.password; sv = document.login.save; if (GetCookie('player') !== null) { usr.value = GetCookie('username'); pw.value = GetCookie('password'); if (GetCookie('save') == 'true') { sv[0].checked = true; } } } function saveme() { if (usr.value.length !== 0 && pw.value.length !== 0) { if (sv[0].checked) { expdate = new Date(); expdate.setTime(expdate.getTime() + (365 * 24 * 60 * 60 * 1000)); SetCookie('username', usr.value, expdate); SetCookie('password', pw.value, expdate); SetCookie('save', 'true', expdate); } if (sv[1].checked) { DeleteCookie('username'); DeleteCookie('password'); DeleteCookie('save'); } } else { alert('You must enter a username/password.'); return false; } } </script> <style type="text/css"> <!-- body { background-image: url('bg25.jpg'); background-color: #000000; margin-top: 0px; margin-bottom: 0px; font-family: calibri, helvetica, arial, geneva, sans-serif; font-size: 12px; color: white; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited, a:active, a:hover, a:link { color: red; text-decoration: none; } table, tr, td { font-family: helvetica, arial, geneva, sans-serif; font-size: 12px; } img { border: none } textarea { font-family: helvetica, arial, geneva, sans-serif; font-size: 12px; color: red; } .table2 { } .lgrad { background-repeat: repeat-y; width: 19px; } .linegrad { background-image: url(linegrad.PNG); background-repeat: repeat-y; background-align: center; width: 2px; } .rgrad { background-repeat: repeat-y; width: 19px; } .dgrad { background-repeat: repeat-x; height: 38px; } .dgradl { background-repeat: no-repeat; height: 38px; width: 38px; } .dgradr { background-repeat: no-repeat; height: 38px; width: 38px; } .center { width: 932px; background-image: url('bg26.jpg'); background-color: #000000; vertical-align: top; text-align: center; } .table { background-color: #FFFFFF } .table3 { background-color: #000000 } .table td { background-color: #DEDEDE; height: 22px; } .table3 td { background-color: #CCCCCC } td .alt { background-color: #EEEEEE; height: 22px; } td .h { background-image: url(tablehgrad.png); background-repeat: repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image: url(tablehgrad.png); background-repeat: repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style></head> <body onload="getme();"> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"><img src="title.jpg" alt="Mccodes Version 2" /> <!-- Begin Main Content --><?php if(file_exists('ipbans/' . $_SERVER['REMOTE_ADDR'])) exit("<b><font color=red size=+1>Your IP has been banned, there is no way around this.</font></b>"); ?> <h3>> <?php echo $set['game_name'];?> Log-In</h3> <table width='80%'> <tr> <td width='50%'><fieldset> <legend>About <?php echo $set['game_name'];?></legend> <?php echo $set['game_description'];?> </fieldset></td> <td><fieldset> <legend>Login</legend> <form action='authenticate.php' method='post' name='login' onsubmit='return saveme();'> Username: <input type='text' name='username' /> Password: <input type='password' name='password' /> Remember me? <input type='radio' value='ON' name='save' />Yes <input type='radio' name='save' value='OFF' checked='checked' />No <input type='submit' value='Submit' /> </form> </fieldset></td> </tr> </table> <h3><a href='register.php'>REGISTER</a> | <a href='tos.php'>TOS</a> | <a href='rules.php'>GAME RULES</a> | <a href='#'>PREVIEW</a> | <a href='forum/Upload'>FORUMS</a> | <a href='leaders.php'>TOP LIST</a></h3> <em><center>Powered by codes made by Dabomstew (© <?php echo date('Y');?>). Game Copyright ©<?php echo date('Y');?> <?php echo $set['game_owner'];?>.</center></em> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <th colspan='2'>Top 5 Players</th> </tr><?php $selectPlayers = $db->query("SELECT `userid`, `username`, `level` FROM `users` ORDER BY `level` DESC LIMIT 5"); while($row = $db->fetch_row($selectPlayers)) { ?><tr> <td><a href='viewuser.php?u=<?php echo $row['userid'];?>'><?php echo stripslashes(htmlspecialchars($row['username']));?></a></td> <td><?php echo $row['level'];?></td> </tr><?php } ?> <tr> <th colspan='2'>Top 5 Gangs</th> </tr><?php $selectPlayers = $db->query("SELECT `gangID`, `gangNAME`, `gangLEVEL` FROM `gangs` ORDER BY `gangLEVEL` DESC LIMIT 5"); while($row = $db->fetch_row($selectPlayers)) { ?><tr> <td><a href='gang.php?ID=<?php echo $row['gangID'];?>'><?php echo stripslashes(htmlspecialchars($row['gangNAME']));?></a></td> <td><?php echo $row['gangLEVEL'];?></td> </tr><?php } ?> </table> </td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </body> </html>
-
Track which query is pegging that error. As soon as you do that, I'll be able to help you :)
-
I'm not at the moment. I'm quite happy with mysqli_* procedural style functions. I'll convert my database abstraction layer to PDO and post up if requested :)
-
Uses my own database abstraction layer (using mysqli_* procedural style (at the moment)) Bugless (as far as I'm aware) Plenty of features Easily customisable I'm in the process of developing a template engine specifically designed for gRP[MTG] Multiple "multi" detection algorithms The only game currently using it has an active userbase. (323 members, currently 26 online, 72 within the last 24 hours) A very active Changelog that allows players to see exactly what's happening in their game The Staff "Panel" makes extensive use of my Staff Permissions, everything is easily customisable for those with the correct rank permissions The gang system was written from scratch and is very in-depth (yet easy to use). (Gang Perks to come soon) A lot more that I don't currently have the time to write (raking out the house)
-
I present to you: manageable permission-based staff ranks In the old system, they're hard-coded in. Any time you want to give a player/staff member access to something new, you must edit the code. In my new system, you simply edit their Staff Rank in the staff panel and access is granted/denied based on exactly what you want. Screenshots of how this works are available further down in another post (due to original site death). All it uses is 1 SQL table, an addition to the (grpg)users table, and a self-caching function to check staff permissions. I'm open to offers and comes with full installation, custom to your design
-
Use the file I have provided. Upload it to your webroot. Make sure the job is scheduled in your crontab
-
Gotta have an ego somewhere :P
-
Testing and fully working: <?php include(__DIR__ . '/config.php'); global $_CONFIG; if(!array_key_exists('code', $_GET) || $_GET['code'] != $_CONFIG['code']) exit; define("MONO_ON", 1); require(__DIR__ . '/class/class_db_'.$_CONFIG['driver'].'.php'); $db = new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c = $db->connection_id; include(__DIR__ . '/global_funcs.php'); $db->query("UPDATE `fedjail` SET `fed_days` = `fed_days` - 1"); $q = $db->query("SELECT * FROM `fedjail` WHERE `fed_days` = 0"); $ids = array(); while($r = $db->fetch_row($q)) array_push($ids, $r['fed_userid']); if(count($ids) > 0) $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); $db->query("DELETE FROM `fedjail` WHERE `fed_days` = 0"); $db->query("UPDATE `users` SET " . "`daysingang` = IF(`gang` > 0, `daysingang` + 1, 0), " . "`daysold` = `daysold` + 1, " . "`boxes_opened` = 0, " . "`mailban` = IF(`mailban` > 0, `mailban` - 1, 0), " . "`donatordays` = IF(`donatordays` > 0, `donatordays` - 1, 0), " . "`cdays` = IF(`course` > 0, `cdays` - 1, 0), " . "`bankmoney` = IF(`bankmoney` > 0, `bankmoney` + (`bankmoney` * .2), 0) " . "`cybermoney` + IF(`cybermoney` > 0, (`cybermoney` * 0.7), 0)" ); $q = $db->query("SELECT `userid`, `course` FROM `users` WHERE `cdays` = 0 AND `course` > 0"); while($r = $db->fetch_row($q)) { $db->query("INSERT INTO `coursesdone` VALUES(".$r['userid'].", ".$r['course'].")"); $cd = $db->query("SELECT * FROM `courses` WHERE `crID` = ".$r['course']); if($db->num_rows($cd)) { $coud = $db->fetch_row($cd); $upd = ""; $ev = ""; if($coud['crSTR']) { $upd .= ", `strength` = `strength` + ".$coud['crSTR']; $ev .= ", ".number_format($coud['crSTR'])." strength"; } if($coud['crGUARD']) { $upd .= ", `guard` = `guard` + ".$coud['crGUARD']; $ev .= ", ".number_format($coud['crGUARD'])." guard"; } if($coud['crLABOUR']) { $upd .= ", `labour` = `labour` + ".$coud['crLABOUR']; $ev .= ", ".number_format($coud['crLABOUR'])." labour"; } if($coud['crAGIL']) { $upd .= ", `agility` = `agility` + ".$coud['crAGIL']; $ev .= ", ".number_format($coud['crAGIL'])." agility"; } if($coud['crIQ']) { $upd .= ", `IQ` = `IQ` + ".$coud['crIQ']; $ev .= ", ".number_format($coud['crIQ'])." IQ"; } $ev = substr($ev, 1); if($upd) $db->query("UPDATE userstats SET `userid` = `userid` ".$upd." WHERE `userid` = ".$r['userid']); event_add($r['userid'], "Congratulations, you completed the ".$coud['crNAME']." and gained ".$ev."!"); } else event_add($r['userid'], "Unfortunately, the course you were taking was removed from the School's curriculum. Your course has been ended at no extra cost to you"); } $db->query("UPDATE `users` SET `course` = 0 WHERE `cdays` = 0"); $db->query("TRUNCATE TABLE `votes`"); PHP: 5.4 Apache: 2.4.7 SQL: 5.6
-
You've clearly never used output buffer handling then :P
-
Ah, fair enough then :P
-
AJAX Tutorial System! [PAID WORK]
Magictallguy replied to Razor42's topic in Requests & In Production
Thank you, but I believe sniko is better suited to this - his knowledge of AJAX far outranks mine Also, my rate is $15 per hour -
AJAX Tutorial System! [PAID WORK]
Magictallguy replied to Razor42's topic in Requests & In Production
Agreed! And no, not "coder", Developer :P -
MagicTallGuy - Mysqli conversion
Magictallguy replied to Zettieee's topic in Collaboration Experiences
Aww, I feel all fuzzy inside now! Thanks guys (and gals, if applicable :P) Well no, I was homeless - story is available on my site 7 years, in fact ;) -
I use gRP[MTG] - does that count?
-
For the record guys, you are more than welcome to ask me directly how to use my stuff ;)
-
Aye, they're available on my site :)
-
What's wrong with the chat I wrote for you?
-
Well.. As far as I'm aware, I haven't died recently - but thanks anyway haha Yes. That's it. I called them "Cronless Crons" because it gets people's attention
-
Based on the previous post (the non-updated one), here: <?php function mail_inbox() { global $ir, $c; ?>Only the last 25 messages sent to you are visible. <hr width='75%' /> <table width="75%" class="table" border="0" cellspacing="1"> <tr> <th width="20%">Sent/From</th> <th width="60%">Subject/Message</th> <th width="20%">Actions</th> </tr><?php $q = mysql_query("SELECT `m`.*, `u`.`userid`, `u`.`username`, `u`.`donatordays`, `u`.`user_level`, `u`.`mail_signature` " . "FROM `mail` AS `m` " . "LEFT JOIN `users` AS `u` ON (`m`.`mail_from` = `u`.`userid`) " . "WHERE `m`.`mail_to` = ".$ir['userid']." AND `m`.`mail_deleted` = 0 " . "ORDER BY `m`.`mail_time` DESC LIMIT 25", $c); if(!mysql_num_rows($q)) echo "<tr><td colspan='2' class='center'>You have no messages</td></tr>"; else while($r = mysql_fetch_assoc($q)) { $d = $r['donatordays'] ? "<img src='/images/donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='Donator: {$r['donatordays']} Days Left' />" : ''; $staff = ($r['user_level'] > 1) ? "<img src='images/staff.gif 'width='10' height='10' alt='Staff' title='Staff' />" : ''; if($r['userid']) { $get = mysql_query("SELECT `imagepath` FROM `user_imageusername` WHERE `userid` = ".$r['userid'], $c); if(mysql_num_rows($get)) $r['username'] = '<img src="images/username/'.$r_image['imagepath'].'" title="'.$r['username'].'" width="110px" height="20px" />'; } if($r['user_level'] == 26) $user = "<span style='color:red;'>".$r['username']."</span>"; else if($r['user_level'] == 2) $user = "<span style='color:gold;'>".$r['username']."</span>"; else if($r['user_level'] == 3) $user = "<span style='color:green;'>".$r['username']."</span>"; else if($r['user_level'] == 4) $user = "<span style='color:pink;'>".$r['username']."</span>"; else if($r['user_level'] == 5) $user = "<span style='color:cyan;'>".$r['username']."</span>"; else if($r['donatordays']) $user = "<span style='color:red;'>".$r['username']."</span>"; else $user = $r['username']; ?><tr> <td><strong>From:</strong><br /><?php echo ($r['userid']) ? "<a href='viewuser.php?u=".$r['userid']."'>".$user."</a> ".$d." ".$staff." [".$r['userid']."]" : ''; ?><br /> <strong>Sent on:</strong> <?php echo date('F j, Y, g:i:s a', $r['mail_time']); ?></td> <td><table class='table' width='100%'> <tr> <td><?php echo stripslashes(htmlspecialchars($r['mail_subject'])); ?></td> </tr> <tr> <td><?php echo nl2br(stripslashes(htmlspecialchars($r['mail_text']))); ?></td> </tr> </table></td> <td><a href='mailbox.php?action=compose&ID=<?php echo $r['userid']; ?>'>Reply</a><br /> <a href='mailbox.php?action=delete&ID=<?php echo $r['mail_id']; ?>'>Delete</a><br /> <a href='preport.php?ID=<?php echo $r['userid']; ?>&report=Fradulent mail: <?php echo urlencode($r['mail_text']); ?>'>Report</a><br /> <a href='mailbox.php?action=addblock&ID=<?php echo $r['userid']; ?>'>Block</a></td> </tr><?php } if($ir['new_mail'] > 0) { mysql_query("UPDATE `mail` SET `mail_read` = 1 WHERE `mail_to` = ".$ir['userid'], $c); mysql_query("UPDATE `users` SET `new_mail` = 0 WHERE `userid` = ".$ir['userid'], $c); } ?></table> <hr width='75%' /> <hr width='90%' /> <table width='50%'> <tr> <td width='50%'><a href='explore.php'>Go Explore</a></td> <td width='50%'><a href='index.php'>Go Home</a></td> </tr> </table> <hr width='90%' /><?php }
-
Conversion to v2 <?php include(__DIR__ . '/globals.php'); if($ir['user_level'] != 2 && $ir['userid'] != 288) { echo "New Roulette being placed"; $h->endpage(); exit(); } $number = rand(1, 36); for($i = 0; $i <= 36; $i++) ${'n' . $i} = abs(@intval($_POST['n' . $i])); $e = abs(intval($_POST['e'])); $o = abs(intval($_POST['o'])); $teen = abs(intval($_POST['teen'])); $teen1 = abs(intval($_POST['teen1'])); $black = abs(intval($_POST['black'])); $red = abs(intval($_POST['red'])); $twelve = abs(intval($_POST['twelve'])); $dtv = abs(intval($_POST['dtv'])); $vtz = abs(intval($_POST['vtz'])); $ek = abs(intval($_POST['ek'])); $tk = abs(intval($_POST['tk'])); $dk = abs(intval($_POST['dk'])); if(!empty($_POST['go4'])) { $sum = array($n0, $n1, $n2, $n3, $n4, $n5, $n6, $n7, $n8, $n9, $n10, $n11, $n12, $n13, $n14, $n15, $n16, $n17, $n18, $n19, $n20, $n21, $n22, $n23, $n24, $n25, $n26, $n27, $n28, $n29, $n30, $n31, $n32, $n33, $n34, $n35, $n36, $e, $o, $teen, $teen1, $black, $red, $twelve, $dtv, $vtz, $ek, $dk, $tk); $bet = array_sum($sum); if($bet > $ir['money']) { echo "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You do not have that much money! <hr width='50%'><a href='index.php'>> Go Home</a><hr width='50%'>"; $h->endpage(); exit; } if($bet > 50000) { echo "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You cannot bet that much money! <hr width='50%'><a href='roulette.php'>> Go Back</a><hr width='50%'>"; $h->endpage(); exit; } if($bet < 1000) { echo "<hr width='50%'>Please read the error message.<hr width='50%'><h3>! ERROR</h3>You need to place more money to the bet! <hr width='50%'><a href='roulette.php'>> Go Back</a><hr width='50%'>"; $h->endpage(); exit; } $nmoney = 0; $nmoney += ${'n' . $number} * 35; $type = ($number % 2 == 0) ? 'even' : 'odd'; $nmoney += ($type == "odd") ? $o * 2 : $e * 2; $nmoney += ($nummer >= 19) ? $high * 2 : $low * 2; $red = $_POST['red']; $black = $_POST['black']; $red22 = array( 1 => 1, 2 => 3, 3 => 5, 4 => 7, 5 => 9, 6 => 12, 7 => 14, 8 => 16, 9 => 18, 10 => 19, 11 => 21, 12 => 23, 13 => 25, 14 => 27, 15 => 30, 16 => 32, 17 => 34, 18 => 36 ); $ii = 1; while($ii < 18) { if($red22[$ii] == $number) { $colour1 = 'red'; $nmoney += $red * 2; } $ii++; } if(!isset($colour1)) { $black1 = array( 1 => 2, 2 => 4, 3 => 6, 4 => 8, 5 => 10, 6 => 13, 7 => 15, 8 => 17, 9 => 20, 10 => 22, 11 => 24, 12 => 26, 13 => 28, 14 => 29, 15 => 31, 16 => 33, 17 => 35 ); $iii = 0; while($iii < 18) { if($black1[$iii] == $number) { $colour1 = 'black'; $nmoney += $black * 2; } $iii++; } } $one218 = array( 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, 6 => 7, 7 => 8, 8 => 9, 9 => 10, 10 => 11, 11 => 12, 12 => 13, 13 => 14, 14 => 15, 15 => 16, 16 => 17, 17 => 18 ); $part = 0; while($part < 17) { if($one218[$part] == $number) $nmoney += $teen * 2; $part++; } $teen236 = array( 0 => 19, 1 => 20, 2 => 21, 3 => 22, 4 => 23, 5 => 24, 6 => 25, 7 => 26, 8 => 27, 9 => 28, 10 => 29, 11 => 30, 12 => 31, 13 => 32, 14 => 33, 15 => 34, 16 => 35, 17 => 36 ); $part1 = 0; while($part1 < 17) { if($teen236[$part1] == $number) $nmoney += $teen1 * 2; $part1++; } $one212 = array( 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, 6 => 7, 7 => 8, 8 => 9, 9 => 10, 10 => 11, 11 => 12 ); $part2 = 0; while($part2 < 11) { if($one212[$part2] == $number) $nmoney += $twelve * 3; $part2++; } $teen2244 = array( 0 => 13, 1 => 14, 2 => 15, 3 => 16, 4 => 17, 5 => 18, 6 => 19, 7 => 20, 8 => 21, 9 => 22, 10 => 23, 11 => 24 ); $part3 = 0; while($part3 < 11) { if($teen2244[$part3] == $number) $nmoney += $dtv * 3; $part3++; } $twen5 = array( 0 => 25, 1 => 26, 2 => 27, 3 => 28, 4 => 29, 5 => 30, 6 => 31, 7 => 32, 8 => 33, 9 => 34, 10 => 35, 11 => 36 ); $part4 = 0; while($part4 < 11) { if($twen5[$part4] == $number) $nmoney += $vtz * 3; $part4++; } $small = array( 0 => 1, 1 => 5, 2 => 9, 3 => 13, 4 => 17, 5 => 21, 6 => 25, 7 => 29, 8 => 33 ); $part5 = 0; while($part5 < 8) { if($small[$part5] == $number) $nmoney += $ek * 3; if($small[$part5] == $number) $nmoney += $tk * 3; if($small[$part5] == $number) $nmoney += $dk * 3; $part5++; } $yougot = $nmoney - $bet; } ?> <table width="75%" border="0" cellspacing="0" cellpadding="0" > <tr> <td>Roulette</td> </tr> </table> <form method="post"> <table width="75%" border="0" cellspacing="0" cellpadding="0" > <tr> <td width="0%" height="48"> </td> <td width="0%"> </td> <td width="0%"> </td> <td width="0%"> </td> <td width="31%"> </td> <td COLSPAN="3" align="center">0 <input name=n0 type=text class="text" ID="n0" size=8 maxlength="10"></td> </tr> <tr> <td height="37"> </td> <td> </td> <td> </td> <td> </td> <td> Max Bet: $50,000 Minimum Bet: $1,000</td> <td width="23%" align="center">1 <input name=n1 type=text class="text" ID="n1" size=8 maxlength="10"></td> <td width="23%" align="center">2 <input name=n2 type=text class="text" ID="n2" size=8 maxlength="10"></td> <td width="23%" align="center">3 <input name=n3 type=text class="text" ID="n3" size=8 maxlength="10"></td> </tr> <tr> <td height="30"> </td> <td> </td> <td> </td> <td> </td> <td align="center"><h2>Money $<?php echo number_format($ir['money']); ?></h2></td> <td align="center">4 <input name=n4 type=text class="text" ID="n4" size=8 maxlength="10"></td> <td align="center">5 <input name=n5 type=text class="text" ID="n5" size=8 maxlength="10"></td> <td align="center">6 <input name=n6 type=text class="text" ID="n6" size=8 maxlength="10"></td> </tr> <tr> <td height="31"> </td> <td> </td> <td> </td> <td> </td> <td align="center"><?php if(!empty($_POST['go4'])) { if($yougot <= 0) { $result = $db->query("UPDATE `users` SET `money` = `money` - " . $bet . " WHERE `userid` = " . $userid); echo "<h3>Wheel Number " . $number . "</h3><font color='#ff000'>You lost $" . number_format($bet) . "</font>"; } elseif($yougot > 0) { $result = $db->query("UPDATE `users` SET `money` = `money` + " . $nmoney . " WHERE `userid` = " . $userid); echo "<h3>Wheel Number " . $number . "</h3><font color='green'>Congratulations you won $" . number_format($nmoney) . "</font>"; } } ?> </td> <td align="center">7 <input name=n7 type=text class="text" ID="n7" size=8 maxlength="10"></td> <td align="center">8 <input name=n8 type=text class="text" ID="n8" size=8 maxlength="10"></td> <td align="center">9 <input name=n9 type=text class="text" ID="n9" size=8 maxlength="10"></td> </tr> <tr> <td height="35"> </td> <td> </td> <td> </td> <td> </td> <td rowspan="12"><img src="images/roulettetable.gif" width="250" height="329"></td> <td align="center">10 <input name=n10 type=text class="text" ID="n10" size=8 maxlength="10"></td> <td align="center">11 <input name=n11 type=text class="text" ID="n11" size=8 maxlength="10"></td> <td align="center">12 <input name=n12 type=text class="text" ID="n12" size=8 maxlength="10"></td> </tr> <tr> <td height="34"> </td> <td> </td> <td> </td> <td> </td> <td align="center">13 <input name=n13 type=text class="text" ID="n13" size=8 maxlength="10"></td> <td align="center">14 <input name=n14 type=text class="text" ID="n14" size=8 maxlength="10"></td> <td align="center">15 <input name=n15 type=text class="text" ID="n15" size=8 maxlength="10"></td> </tr> <tr> <td height="34"> </td> <td COLSPAN="3"> </td> <td align="center">16 <input name=n16 type=text class="text" ID="n16" size=8 maxlength="10"></td> <td align="center">17 <input name=n17 type=text class="text" ID="n17" size=8 maxlength="10"></td> <td align="center">18 <input name=n18 type=text class="text" ID="n18" size=8 maxlength="10"></td> </tr> <tr> <td height="35"> </td> <td COLSPAN="3"> </td> <td align="center">19 <input name=n19 type=text class="text" ID="n19" size=8 maxlength="10"></td> <td align="center">20 <input name=n20 type=text class="text" ID="n20" size=8 maxlength="10"></td> <td align="center">21 <input name=n21 type=text class="text" ID="n21" size=8 maxlength="10"></td> </tr> <tr> <td height="38"> </td> <td> </td> <td> </td> <td> </td> <td align="center">22 <input name=n22 type=text class="text" ID="n22" size=8 maxlength="10"></td> <td align="center">23 <input name=n23 type=text class="text" ID="n23" size=8 maxlength="10"></td> <td align="center">24 <input name=n24 type=text class="text" ID="n24" size=8 maxlength="10"></td> </tr> <tr> <td height="33"> </td> <td> </td> <td> </td> <td> </td> <td align="center">25 <input name=n25 type=text class="text" ID="n25" size=8 maxlength="10"></td> <td align="center">26 <input name=n26 type=text class="text" ID="n26" size=8 maxlength="10"></td> <td align="center">27 <input name=n27 type=text class="text" ID="n27" size=8 maxlength="10"></td> </tr> <tr> <td height="37"> </td> <td> </td> <td> </td> <td> </td> <td align="center">28 <input name=n28 type=text class="text" ID="n28" size=8 maxlength="10"></td> <td align="center">29 <input name=n29 type=text class="text" ID="n29" size=8 maxlength="10"></td> <td align="center">30 <input name=n30 type=text class="text" ID="n30" size=8 maxlength="10"></td> </tr> <tr> <td height="35"> </td> <td> </td> <td> </td> <td> </td> <td align="center">31 <input name=n31 type=text class="text" ID="n31" size=8 maxlength="10"></td> <td align="center">32 <input name=n32 type=text class="text" ID="n32" size=8 maxlength="10"></td> <td align="center">33 <input name=n33 type=text class="text" ID="n33" size=8 maxlength="10"></td> </tr> <tr> <td height="32"> </td> <td> </td> <td> </td> <td> </td> <td align="center">34 <input name=n34 type=text class="text" ID="n34" size=8 maxlength="10"></td> <td align="center">35 <input name=n35 type=text class="text" ID="n35" size=8 maxlength="10"></td> <td align="center">36 <input name=n36 type=text class="text" ID="n36" size=8 maxlength="10"></td> </tr> <tr> <td height="40"> </td> <td> </td> <td> </td> <td> </td> <td align="center">odd <input name=o type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">19- 36 <input name=teen type=text class="text" ID="teen" size=8 maxlength="10"></td> <td align="center">Even <input name=e type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="53"> </td> <td> </td> <td> </td> <td> </td> <td align="center">red <input name=red type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">1 - 18 <input name=teen type=text class="text" ID="teen" SIZE=8 maxlength="10"></td> <td align="center">black <input name=black type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="58"> </td> <td> </td> <td> </td> <td> </td> <td align="center">1 -12 <input name=twelve type=text class="text" ID="twelve" SIZE=8 maxlength="10"></td> <td align="center">13 -24 <input name=dtv type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">25-36 <input name=vtz type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="65"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center">1st column <input name=ek type=text class="text" SIZE=8 maxlength="10"></td> <td align="center">2nd column <input name=tk type=text class="text" SIZE=8 align="10"></td> <td align="center">3rd column <input name=dk type=text class="text" SIZE=8 maxlength="10"></td> </tr> <tr> <td height="37"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td align="center"><input name='go4' type=submit class="buttong" value=Bet> <input type=reset class="buttong" value=Reset></td> <td> </td> </tr> </table></form><?php $h->endpage();