Jump to content
MakeWebGames

Mystical

Members
  • Posts

    266
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Mystical

  1. So if you added more to the array would it work? Actually if anyone has anything to add to make it so it does stop all attacks please do so. It would benefit everyone.
  2. Found this on my travels and was wondering if it would stop some sql injections during login? FUNCTION anti_injection( $user, $pass ) { // We'll first get rid of any special characters using a simple regex statement. // After that, we'll get rid of any SQL command words using a string replacment. $banlist = ARRAY ( "insert", "select", "update", "delete", "distinct", "having", "truncate", "replace", "handler", "like", " as ", "or ", "procedure", "limit", "order by", "group by", "asc", "desc" ); // --------------------------------------------- IF ( EREGI ( "[a-zA-Z0-9]+", $user ) ) { $user = TRIM ( STR_REPLACE ( $banlist, '', STRTOLOWER ( $user ) ) ); } ELSE { $user = NULL; } // --------------------------------------------- // Now to make sure the given password is an alphanumerical string // devoid of any special characters. strtolower() is being used // because unfortunately, str_ireplace() only works with PHP5. IF ( EREGI ( "[a-zA-Z0-9]+", $pass ) ) { $pass = TRIM ( STR_REPLACE ( $banlist, '', STRTOLOWER ( $pass ) ) ); } ELSE { $pass = NULL; } // --------------------------------------------- // Now to make an array so we can dump these variables into the SQL query. // If either user or pass is NULL (because of inclusion of illegal characters), // the whole script will stop dead in its tracks. $array = ARRAY ( 'user' => $user, 'pass' => $pass ); // --------------------------------------------- IF ( IN_ARRAY ( NULL, $array ) ) { DIE ( 'Invalid use of login and/or password. Please use a normal method.' ); } ELSE { RETURN $array; } }
  3. That did it! Thank you so much Lithium. What a pain in the #@* ! Glad you saw that. I was about ready to say the hell with the Hall of Fame. Thanks again.
  4. No change. Still 0 when I click on crystals. Thanks for trying to help.
  5. I have been looking at this thing for days trying to figure out why when you click on Crystals it says 0 even though I have 1230? I would appreciate a helping hand. Thanks in advance. This is the code. Tried to add code tags but it does not work.....   <?php include_once "globals.php"; $filters = array( 'nodon' => 'AND donatordays=0', 'don' => 'AND donatordays > 0', 'all' => '' ); $hofheads = array( 'level', 'money', 'crystals', 'respect', 'total', 'strength', 'agility', 'guard', 'labour', 'iq' ); $_GET['action'] = (in_array($_GET['action'],$hofheads))?$_GET['action']:'level'; $filter = (isset($filters[$_GET['filter']]))?$_GET['filter']:'all'; $myf = $filters[$filter]; $hofqone = array( 'level', 'money', 'crystals' ); if ( in_array($_GET['action'], $hofqone) ) { $q = $db->query("SELECT u.`userid`, `laston`, `gender`, `donatordays`, `username`, `level`, `money`, g.`gangPREF` FROM users u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY {$_GET['action']} DESC,userid ASC LIMIT 20"); } $hofqtwo = array( 'total', 'strength', 'agility', 'guard', 'labour', 'iq' ); if ( in_array($_GET['action'], $hofqtwo) ) { if ( $_GET['action'] == 'total' ) { $us = '(us.`strength`+us.`agility`+us.`guard`+us.`labour`+us.`IQ`)'; } else { $us = 'us.`'.$_GET['action'].'`'; } $q = $db->query("SELECT u.`userid`, `laston`, `gender`, `donatordays`, `level`, `money`, `crystals`, `username`, g.`gangPREF`, us.`strength`, `agility`, `guard`, `labour`, `IQ` FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 $myf ORDER BY {$us} DESC,u.userid ASC LIMIT 20"); } if ( $_GET['action'] != 'respect' ) { $non_don = (($filter == 'nodon')?'<b>':'').'<a href="halloffame.php?action='.$_GET['action'].'&filter=nodon">Non-Donators</a>'.(($filter == 'nodon')?'</b>':''); $is_don = (($filter == 'don')?'<b>':'').'<a href="halloffame.php?action='.$_GET['action'].'&filter=don">Donators</a>'.(($filter == 'don')?'</b>':''); $all_us = (($filter == 'all')?'<b>':'').'<a href="halloffame.php?action='.$_GET['action'].'&filter=all">All Users</a>'.(($filter == 'all')?'</b>':''); } echo " <h3>Hall Of Fame</h3> ".(( $_GET['action'] != 'respect' )?'<hr />Filter: ['.$non_don.' | '.$is_don.' | '.$all_us.']<hr />':'')." <table width='60%' cellpadding='1' cellspacing='1' class='table'> <tr> <td><a href='halloffame.php?action=level&filter={$filter}'>LEVEL</a></td> <td><a href='halloffame.php?action=money&filter={$filter}'>MONEY</a></td> <td><a href='halloffame.php?action=crystals&filter={$filter}'>CRYSTALS</a></td> <td><a href='halloffame.php?action=respect&filter={$filter}'>RESPECT</a></td> <td><a href='halloffame.php?action=total&filter={$filter}'>TOTAL STATS</a></td> </tr> <tr> <td><a href='halloffame.php?action=strength&filter={$filter}'>STRENGTH</a></td> <td><a href='halloffame.php?action=agility&filter={$filter}'>AGILITY</a></td> <td><a href='halloffame.php?action=guard&filter={$filter}'>GUARD</a></td> <td><a href='halloffame.php?action=labour&filter={$filter}'>LABOUR</a></td> <td><a href='halloffame.php?action=iq&filter={$filter}'>IQ</a></td> </tr> </table> "; switch($_GET['action']) { case "level": hof_level(); break; case "money": hof_money(); break; case "crystals": hof_crystals(); break; case "respect": hof_respect(); break; case "total": hof_total(); break; case "strength": hof_strength(); break; case "agility": hof_agility(); break; case "guard": hof_guard(); break; case "labour": hof_labour(); break; case "iq": hof_iq(); break; } function hof_level() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest levels <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Level</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> <td>'.$r['level'].'</td> </tr> '; } echo '</table>'; } function hof_money() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest amount of money <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Money</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> <td>'.money_formatter($r['money'],'$').'</td> </tr> '; } echo '</table>'; } function hof_crystals() { global $db,$ir,$c,$userid,$myf; echo " Showing the 20 users with the highest amount of crystals <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> <th>Crystals</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> <td>'.money_formatter($r['crystals'],'').'</td> </tr> '; } echo '</table>'; } function hof_respect() { global $db,$ir,$c,$userid; echo " Showing the 20 gangs with the highest amount of respect <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>Gang</th> <th>Respect</th> </tr> "; $q = $db->query("SELECT `gangID`,`gangNAME`,`gangRESPECT` FROM `gangs` ORDER BY `gangRESPECT` DESC,`gangID` ASC LIMIT 20"); $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['gangID'] == $ir['gang'])?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangNAME'].' ['.$r['gangID'].']</td> <td>'.money_formatter($r['gangRESPECT'],'').'</td> </tr> '; } echo '</table>'; } function hof_total() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest total stats <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> </tr> '; } echo '</table>'; } function hof_strength() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest strength <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> </tr> '; } echo '</table>'; } function hof_agility() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest agility <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> </tr> '; } echo '</table>'; } function hof_guard() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest guard <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> </tr> '; } echo '</table>'; } function hof_labour() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest labour <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> </tr> '; } echo '</table>'; } function hof_iq() { global $db,$ir,$c,$userid, $myf; echo " Showing the 20 users with the highest IQ <br /> <table width='60%' cellspacing='1' class='table'> <tr style='background:gray'> <th>Pos</th> <th>User</th> </tr> "; $p = 0; while ( $r = $db->fetch_row($q) ) { $p++; $bold_hof = ($r['userid'] == $userid)?' style="font-weight: bold;"':''; echo ' <tr '.$bold_hof.'> <td>'.$p.'</td> <td>'.$r['gangPREF'].' '.$r['username'].' ['.$r['userid'].']</td> </tr> '; } echo '</table>'; } $h->endpage(); ?>
  6. My mother will write love letters for you for the low low price of $1.00.....
  7. Put this search in google..... onebip scam Just a heads up.
  8. I just did a search on how to improve a web sites speed with .htaccess and found the link here : http://forums.hostgator.com/speed-up-your-site-htaccess-t132870.html?amp I found it a while ago but kept forgetting to post it here for everyone. It does work pretty well! My site was slower than molasses until I added that code. Gotta love the internet and smart people!
  9. It is nice to add believe me. It made my game 100 times faster than it was. The only downside was mentioned by US Vice. If you have all your graphics in place and don't intend to change them like me then you are fine. You could always change the file name of the graphics file if you do decide to update a graphic.
  10. This part made me laugh...."stab you up" Is that worse than getting stabbed down? Sorry....little things amuse me.
  11. I ran across this on my travels and it works like a charm! I can see a massive increase in my page loading speed. Add this to your .htaccess file. # Cache static content for 1 MONTH <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4|css|js|txt|xml)$"> Header set Cache-Control "public" Header set Cache-Control "max-age=2592000, public" Header unset Last-Modified </FilesMatch> # Remove ETag headers Header unset ETag FileETag None # compress text, html, javascript, css, xml: AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/x-javascript
  12. Isn't this Isomerizer‎'s Cock Fight mod but with dogs? Looks pretty much the same.
  13. Mystical

    Wow

    This is a quote from you on another post....."OK guys, I'm in way over my head". By reading some of your previous posts it seems like you have no idea how to do even the simplest things. You seriously cant blame that on the game code. I had no idea what I was doing either when I first got into making my game but now I am doing ok. Not great mind you but ok.... Some of the people here can be very helpful. I would imagine that calling people names isn't going to get you to far. Your wine & dined statement did make me almost choke on my milk though....
  14. I had the same problem and this is how I solved it. */5 * * * * wget -c http://www.yourgame.com/cron_fivemins.php?code=your code here Try it and see if it works then. Good luck to you.
  15. I gave up on REDUX three days after I bought it. I guess if you were a wizard at php you wouldn't have any problems but if you are not (like me) you just look at REDUX like a disease and remove the growth. I couldn't even add a custom template to it because I couldn't figure it out. I wish the makers left it like it was....easy to work with like v2.03.
  16. http://makewebgames.io/showthread.php/39502-Tutorial-v2.0.3-v2.5-convertion?highlight=redux Here ya go... Good luck.
  17. Thank you for trying to help me. I do appreciate it but that didn't work either. It does not show anything now.... Dayo made this so I am hoping he will answer this post and help me figure this out. Thanks again bineye.
  18. Tried that and got this Parse error: syntax error, unexpected T_STRING in /home/westernv/public_html/chat.php on line 12 It is possessed.
  19. That worked for users who are not id1 but now id can see it? No one should see it unless they are trying to delete messages and are not id1.
  20. No I mean that if you are any user except id1 this shows and should not unless someone is trying to delete messages who is not the admin.
  21. Next to the message that is submitted. Another problem I cant figure out. I keep getting this on any user but id1 without doing anything. http://i51.tinypic.com/v7xe1u.png "Nope that dont work" The code:   <?php include 'globals.php'; // the staff functions if ($ir['user_level']>1) { // Delete post if ($_GET['action']=='del' && isset($_GET['id'])) { mysql_query("DELETE FROM `chat` WHERE `id`=".abs(intval($_GET['id']))); } } else {echo 'Nope that dont work!';} ?> <script type="text/javascript" src="send.js"></script> <link rel="stylesheet" type="text/css" href="ajch.css"> <form name="chatform" onSubmit="send();return false;"> <!--<textarea name="chatresp" cols="50" rows="10" id="chatresp" readonly="readonly"></textarea><br>--> <div id="chatresp" name="chatresp"></div> <input type="hidden" name="guestname" id="name" size="7"> <input type="text" name="chatext" style="width:325px" id="chatext"><input type="submit" value="Send" style="width:75px" onClick="send();return false;"> </form> <div style="width:400px; text-align:left"><small style="color:#00FF00;">[bB-Code ~ Enabled]</small></div> <?php $h->endpage(); ?>
  22. I know this is an old post so don't kill me........ Nice chat but for some reason it does not show the time stamp. How do I make it so oh mccodes gurus?
  23. Easy man.... I was just jerking your chain.....Joking.
  24. It is the files Peter and my lack of skill with coding to fix them. I am learning thanks to you guys. From the help that Dominion just gave me I have fixed about 5 mods so they actually work and the template you made me looks nice when I can get it to work.... ;)
  25. That did it Dominion! Thank you so much. I have been pulling out my hair for 2 weeks now trying to figure it out. Worked great. I must of done a million searches for an answer and nothing worked. Much appreciated. I wish this mcocdes stuff was html. That I can do with my eyes closed.
×
×
  • Create New...