Jump to content
MakeWebGames

bloodless2010

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by bloodless2010

  1. I did ask for people not to tell me how to fix it, just what pages need securing.
  2. if you're going to "help" me, pretty muching helping me will help me.
  3. Hey again. I'm sorry I keep asking for help its just I'm a noob here :p I just want to ask are there and SQL vulnerability's in V1? If there are any, please tell me what they are so I can fix them! You don't need to tell me exactly what it is only the page and what part is the vulnerability. Thanks.
  4. [strikeout]Also one more thing, the bank and cyberbank money isnt' saving with my user? edit; it isn't saving for any users it's just the cyberbank and bank.[/strikeout] I talk before I check it out most of the time sorry, I found the error, it wasn't in the query list for some reason
  5. This doesn't work, If you change $userid to $user, when I save the edit, it replaced my player (ID #1) with what I just saved.. EDIT; derp nevermind, I derped and edited the wrong ones because I had already edited it so the lines where at a different place XD Thanks! Works like a charm, thank you so much, now I can focus on more important things in my game ! :D
  6. Ty for posting Sahed, I hope we can get this fixed,   DO NOT REMOVE THE USERNAME IN USE CHECKER! IT WILL MAKE IT SAVE, BUT IT WILL OVERWRITE ALL THE DATA OF THE USER YOU'RE EDITING OVER YOURS! D: <-- Learnt it the hard way.
  7. Okay guys, I have a problem and I'm using the default staff panel for V1, But here's a weird error, Whenever I edit a user (that's not myself) for example if I edit user 2 and click submit, it will tell me that 'That username is already in use.' When I removed the code that checked for that, I noticed that the submit button only edits the code for MY user, (ID 1). So I don't understand how this is happening, I haven't changed any of the code, Example; I edit user ID #2, and click the submit info button for the editing, it tells me Username is already in use. This is because it thinks the userid is always 1. So basically whoever I edit it's really editing myself, but shows their info. Please help me! I'm really confused by this.
  8. Because there's nothing showing at all. (On the page that is, a complete white screen where it should display the PHP error.)
  9. @Djkanna, i've already tried error_reporting(E_ALL); , It doesn't work.
  10. I don't know the problems because I can't get the errors to show xD
  11. Okay so first of all I'd like to say that errors aren't showing on my game, I'm using V1 if that helps, I need them to display because ATM I have no idea what's wrong with this factions code: <?php session_start(); require "global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is = mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); print "<font face='Arial' size='4'>Factions</font><hr width='90%'>"; switch ($_GET['step']) { case 'create': create_faction(); break; case 'profile': faction_profile(); break; case 'users': faction_members(); break; case 'search': search_factions(); break; case 'apply': faction_apply(); break; default: factions_index(); break; } function factions_index() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.userid = fa.faLEADER) ORDER BY faID DESC"); $q = mysql_query($sql); print "This is a list of all factions by ID <table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='25%'>Name</th><th width='13%'>Members</th><th width='12%'>Reputation</th><th width='50%'>Image</th></tr>"; while($r = mysql_fetch_array($q)) { print "<tr><td><a href='factions.php?step=profile&ID={$r['faID']}'><h3>{$r['faNAME']}</h3></a></td><td>"; $membs = sprintf("SELECT * FROM `users` WHERE faction = %u", mysql_real_escape_string($r['faID'])); $mems = mysql_query($membs); print mysql_num_rows($mems)."</td> <td>{$r['faREPUTATION']}</td> <td>{$r['faIMAGE']}</td></tr>"; } print "</table> <hr width='90%'>> <a href='explore.php'>Back</a><hr width='90%'>"; } function create_faction() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` WHERE faID > 0"); $q = mysql_query($sql); $fcs = mysql_num_rows($q); $r['faCOST'] = ($fcs*10000); if($ir['money'] < $r['faCOST']) { print " You don't have enough money. It costs ".money_formatter($r['faCOST'])." to create a new Faction. <hr width='90%'>> <a href='explore.php' target='_blank'>Back</a><hr width='90%'>"; } else if($ir['faction'] > 0) { print " You are already part of a Faction. Leave before creating a new one. <hr width='90%'>> <a href='explore.php' target='_blank'>Back</a><hr width='90%'>"; } else if($_POST['name'] AND $_POST['description'] AND $_POST['status']) { $ins = sprintf("INSERT INTO `factions` (`faID`, `faNAME`, `faDESC`, `faSTATUS`, `faLEADER`, `faCOLEADER`, `faCAPACITY`, `faREPUTATION`) VALUES ('NULL','%s', '%s', '%s', '%d', '%d', '%d', '%d')", mysql_real_escape_string($_POST['name']), mysql_real_escape_string($_POST['description']), mysql_real_escape_string($_POST['status']), $userid, $userid, 10, 100); mysql_query($ins); $r['insID'] = mysql_insert_id($c); $fac = sprintf("UPDATE `users` SET faction = %d, money=money-%d WHERE (userid = %u)", $r['insID'], $r['faCOST'], $userid); mysql_query($fac); print " The {$_POST['name']} faction was successfully created. <hr width='90%'>> <a href='factions.php?step=manage' target='_blank'>Back</a><hr width='90%'>"; } else { print " <form action='factions.php?step=create' method='post'> A new faction will cost $10,000 times the amount of factions in existence. The current price is <b>".money_formatter($r['faCOST'])."</b>. Name your Faction <input type='text' name='name' /> Choose a Status <select type='dropdown' name='status'> <option value='Peaceful'>Peaceful</option> <option value='Aggressive'>Aggressive</option> </select> Description <textarea name='description' cols='40' rows='7'></textarea> <input type='submit' value='Create' /></form> <hr width='90%'>> <a href='factions.php' target='_blank'>Back</a><hr width='90%'>"; } } function faction_profile() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.userid = fa.faLEADER) WHERE (fa.faID = %u)", mysql_real_escape_string($_GET['ID'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); print " <table width='400' bgcolor='#DFDFDF'><tr><td align='center'><b><font size='5'>{$r['faNAME']}</font></b></td></tr></table> {$r['faDESC']} <p>error here.</p> <table width='400' bgcolor='#DFDFDF'><tr><td valign='middle' align='center'><font size='5'><b>{$r['faREPUTATION']}</b></font></td></tr></table> <table width='400' bgcolor='#DFDFDF'><tr><td width='200' valign='middle'> <b>Leader: </b><a href='viewuser.php?u={$r['userid']}>{$r['username']}</a> "; $col = sprintf("SELECT * FROM `users` WHERE (userid = %u)", mysql_real_escape_string($r['faCOLEADER'])); $q2 = mysql_query($col); $co = mysql_fetch_array($q2); print "<b>Co-Leader: </b><a href='viewuser.php?u={$co['userid']}'>{$co['username']}</a> "; $membs = sprintf("SELECT * FROM `users` WHERE faction = %u", mysql_real_escape_string($r['faID'])); $mems = mysql_query($membs); print "<b>Members: </b>'.mysql_num_rows($mems).' <b>Reputation: </b>{$r['faREPUTATION']} <b>Current chain: </b>{$r['faCHAIN']} attacks <b>Best chain: </b>{$r['faBCHAIN']} attacks <b>Status: </b>"; if ($r['faSTATUS'] == 'Peaceful') { print "<font color='green'><b>Peaceful</b></font>"; } else { print "<font color='red'><b>Aggressive</b></font>"; } print " </td> <td valign='top' align='right' width='200'><a href='factions.php?step=users&ID={$r['faID'}}>User list</a> < <a href='factions.php?step=apply&ID={$r['faID']}'>Apply</a> < </td></tr></table> <table width='400' bgcolor='#DFDFDF'><tr> <td width='50%' height='100%'> <table width='100%' height='100%'><tr> <td align='center'> {$r['faDESC']} </td> </tr></table></td></tr></table> <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } function faction_members() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.faction = fa.faID) WHERE (fa.faID = %u)", mysql_real_escape_string($_GET['ID'])); $q = mysql_query($sql); print "<table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='25%'>Num</th><th width='25%'>Name</th><th width='25%'>Level</th><th width='25%'>Days in Faction</th></tr>"; while ($r = mysql_fetch_array($q)) { $cn++; print "<tr><td>$cn.</td><td><a href='viewuser.php?u={$r['userid']}>{$r['username']}</a></td><td>{$r['level']}</td><td>{$r['faction_days']}</td></tr>"; } print "</table> <hr width='90%'>> <a href='factions.php?step=profile&ID={$_GET['ID']}'>Back</a><hr width='90%'>"; } function search_factions() { global $ir,$c,$userid,$h; if (!$_POST['name']) { print "<form action='factions.php?step=search' method='post'> <b>Search by Keyword</b> Insert the keyword that you'd like to search for Factions: <input type='text' name='name'> <input type='submit' value='Search'></form> <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } else { $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.userid = fa.faLEADER) WHERE (`faNAME` LIKE '%%%s%%')", mysql_real_escape_string($_POST['name'])); $q = mysql_query($sql); print "<b>Search by Keyword</b> Keyword: {$_POST['name']} <table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='25%'>Name</th><th width='13%'>Members</th><th width='12%'>Reputation</th><th width='50%'>Image</th></tr>"; while($r = mysql_fetch_array($q)) { print "<tr><td><a href='factions.php?step=profile&ID={$r['faID']}><h3>{$r['faNAME']}</h3></a></td><td>"; $membs = sprintf("SELECT * FROM `users` WHERE faction = %u", mysql_real_escape_string($r['faID'])); $mems = mysql_query($membs); print mysql_num_rows($mems)."</td> <td>{$r['faREPUTATION']}</td> <td>{$r['faNAME']} name</td></tr>"; } print "</table> <hr width='90%'>> <a href='factions.php?step=search'>Back</a><hr width='90%'>"; } } function faction_apply() { global $ir,$c,$userid,$h; if ($ir['faction']) { print " You are already in a faction at this time. <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } else if (!$_GET['act']) { print " Please type an application to this faction below: <form action='factions.php?step=apply&act=submit&ID={$_G ET['ID']}' method='post'> <textarea type='text' name='app' cols='50' rows='8'>Type your application here</textarea> <input type='submit' value='Submit'></form> <hr width='90%'>> <a href='factions.php?step=profile&ID={$_GET['ID']}>Back</a><hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['app']) { $ins = sprintf("INSERT INTO `faction_apps` (`fpID`, `fpUSER`, `fpFACTION`, `fpAPP`, `fpTIME`) VALUES ('NULL','%d', '%d', '%s', '%d')", mysql_real_escape_string($ir['userid']), mysql_real_escape_string($_GET['ID']), mysql_real_escape_string($_POST['app']), time()); mysql_query($ins); print " Your application was submitted! <hr width='90%'>> <a href='factions.php?step=profile&ID={$_GET['id']}'>Back</a><hr width='90%'>"; } else { print " You did not type an application to send! <hr width='90%'>> <a href='factions.php?step=apply&ID={$_GET['ID']}'>Back</a><hr width='90%'>"; } } } $h->endpage(); ?>
  12. I don't understand how you mean, because they look into a certain table, and I'm not very good at MySQL, I know the PHP I think, but not how to use MySQL, I just want it to count how many users have more then 0 jail/hospital time. Edit; Nevermind! I worked it out, thanks for giving me the idea! :D
  13. Fixed it, I had to change $color to '$color' thanks everyone for trying.
  14. Still doesn't work after I quoted the strings. function color_change() { global $ir,$c,$userid,$h; print "<h3>Change Name Color</h3> Below are a list of colors in which you can change your name to with an example of each.... <form action='preferences.php?action=colorchange2' method='post'> Color: <select name='color' type='dropdown'> <option value='white'><font color=none>None</font> <option value='red'><font color=red>Red</font> <option value='blue'><font color=blue>Blue</font> <option value='green'><font color=green>Green</font> <input type='submit' value='Change color' /></form>"; } function do_color_change() { global $db,$ir,$c,$userid,$h; if($_POST['color'] == 'none') { $color = white; } if($_POST['color'] == 'red') { $color = red; } if($_POST['color'] == 'blue') { $color = blue; } if($_POST['color'] == 'green') { $color = green; } mysql_query("UPDATE users SET username_color=$color WHERE userid=$userid"); print "Name Color Changed!<br />"; print "<a href='preferences.php?action=colorchange'>Back</a>"; }
  15. case 'colorchange2': do_color_change(); break; case 'colorchange': color_change(); break; is what I have on the top of the page.
  16. Hey again, how do I display the amount of users in jail/hospital in V1? I'm using this jail for V1: http://makewebgames.io/showthread.php/31352-mccode-v1-Mccodes-V1-Jail My Mainmenu: <?php /* MCCodes FREE mainmenu.php Rev 1.1.0 Copyright (C) 2005-2012 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ if (strpos($_SERVER['PHP_SELF'], "mainmenu.php") !== false) { exit; } global $c, $ir; if (!$ir['hospital']) { print "<a href='index.php'>Home</a><br /> <a href='inventory.php'>Items</a><br /> <a href='explore.php'>Explore</a><br /> <a href='events.php'>"; $d = mysql_query( "SELECT COUNT(*) as cnt FROM events WHERE evUSER={$ir['userid']} AND evREAD=0", $c) or die(mysql_error()); $r = mysql_fetch_array($d); if ($r['cnt'] > 0) { print "<b>Events ({$r['cnt']})</b>"; } else { print "Events (0)"; } print "</a><br /> <a href='mailbox.php'>"; $d2 = mysql_query( "SELECT COUNT(*) as cnt FROM mail WHERE mail_to={$ir['userid']} AND mail_read=0", $c) or die(mysql_error()); $r = mysql_fetch_array($d2); if ($r['cnt'] > 0) { print "<b>Mail ({$r['cnt']})</b>"; } else { print "Mail (0)"; } print "</a><br /> <a href='gym.php'>Gym</a><br /> <a href='criminal.php'>Crimes</a><br /> <a href='jail.php'>Jail ()</a><br /> <a href='hospital.php'>Hospital ()</a><br /> <a href='education.php'>Local School</a><br /> <a href='monopaper.php'>Announcements</a><br /> <a href='search.php'>Search</a><br /> <a href='advsearch.php'>Advanced Search</a><br />"; if ($ir['user_level'] > 1) { print "<hr /> <b>Staff Only</b><br />\n"; if ($ir['user_level'] < 6 and $ir['user_level'] != 4) { print "<a href='new_staff.php'>Staff Panel</a><br />\n"; } } if ($ir['user_level'] > 1) { print "<hr /><b>Staff Online:</b><br />"; $q = mysql_query( "SELECT * FROM users WHERE laston > " . (time() - 900) . " AND user_level>1 ORDER BY userid ASC", $c); while ($r = mysql_fetch_array($q)) { $la = time() - $r['laston']; $unit = "secs"; if ($la >= 60) { $la = (int) ($la / 60); $unit = "mins"; } if ($la >= 60) { $la = (int) ($la / 60); $unit = "hours"; if ($la >= 24) { $la = (int) ($la / 24); $unit = "days"; } } print "<a href='viewuser.php?u={$r['userid']}'><font color={$r['username_color']}>{$r['username']}</font></a> ($la $unit)<br />"; } } if ($ir['donatordays']) { print "<hr /> <b>Donators Only</b><br /> <a href='friendslist.php'>Friends List</a><br /> <a href='blacklist.php'>Black List</a>"; } print "<hr /> <a href='preferences.php'>Preferences</a><br /> <a href='preport.php'>Player Report</a><br /> <a href='helptutorial.php'>Help Tutorial</a><br /> <a href='gamerules.php'>Game Rules</a><br /> <a href='viewuser.php?u={$ir['userid']}'>My Profile</a><br /> <a href='logout.php'>Logout</a><br /><br /> Time is now<br /> "; echo date('F j, Y') . "<br />" . date('g:i:s a'); } else { print "<a href='index.php'>Home</a><br /> <a href='inventory.php'>Items</a><br /> <a href='events.php'>"; $d = mysql_query( "SELECT COUNT(*) as cnt FROM events WHERE evUSER={$ir['userid']} AND evREAD=0", $c) or die(mysql_error()); $r = mysql_fetch_array($d); if ($r['cnt'] > 0) { print "<b>Events ({$r['cnt']})</b>"; } else { print "Events (0)"; } print "</a><br /> <a href='mailbox.php'>"; $d2 = mysql_query( "SELECT COUNT(*) as cnt FROM mail WHERE mail_to={$ir['userid']} AND mail_read=0", $c) or die(mysql_error()); $r = mysql_fetch_array($d2); if ($r['cnt'] > 0) { print "<b>Mail ({$r['cnt']})</b>"; } else { print "Mail (0)"; } print "</a><br /> <a href='monopaper.php'>Announcements</a><br /> <a href='search.php'>Search</a><br />"; if ($ir['user_level'] > 1) { print "<hr /> <b>Staff Only</b><br />"; if ($ir['user_level'] < 6 and $ir['user_level'] != 4) { print "<a href='new_staff.php'>Staff Panel</a><br />\n"; } } if ($ir['user_level'] > 1) { print "<hr /><b>Staff Online:</b><br />"; $q = mysql_query( "SELECT * FROM users WHERE laston>(" . time() . "-15*60) AND user_level>1 ORDER BY userid ASC", $c); while ($r = mysql_fetch_array($q)) { $la = time() - $r['laston']; $unit = "secs"; if ($la >= 60) { $la = (int) ($la / 60); $unit = "mins"; } if ($la >= 60) { $la = (int) ($la / 60); $unit = "hours"; if ($la >= 24) { $la = (int) ($la / 24); $unit = "days"; } } print "<a href='viewuser.php?u={$r['userid']}'><font color={$r['username_color']}>{$r['username']}</font></a> ($la $unit)<br />"; } } if ($ir['donatordays']) { print "<hr /> <b>Donators Only</b><br /> <a href='friendslist.php'>Friends List</a><br /> <a href='blacklist.php'>Black List</a>"; } print "<hr /> <a href='preferences.php'>Preferences</a><br /> <a href='preport.php'>Player Report</a><br /> <a href='helptutorial.php'>Help Tutorial</a><br /> <a href='gamerules.php'>Game Rules</a><br /> <a href='viewuser.php?u={$ir['userid']}'>My Profile</a><br /> <a href='logout.php'>Logout</a><br /><br /> Time is now<br /> "; echo date('F j, Y') . "<br />" . date('g:i:s a'); }   ATM I'm just using (), but I want it to display like (5) if 5 people are in jail/hospital ect. Thank you!
  17. Hey guys, The majority of this mod works, for example it displays the colors everywhere I need it to, and it has the correct column, I can edit the color manually in the MySQL database, for example I used the color green and everywhere where it says my name is in green, but the form to submit the colour doesn't work?   function color_change() { global $ir,$c,$userid,$h; print "<h3>Change Name Color</h3> Below are a list of colors in which you can change your name to with an example of each.... <form action='preferences.php?action=colorchange2' method='post'> Color: <select name='color' type='dropdown'> <option value='white'><font color=none>None</font> <option value='red'><font color=red>Red</font> <option value='blue'><font color=blue>Blue</font> <option value='green'><font color=green>Green</font> <input type='submit' value='Change color' /></form>"; } function do_color_change() { global $db,$ir,$c,$userid,$h; if($_POST['color'] == none) { $color = "white"; } if($_POST['color'] == red) { $color = "red"; } if($_POST['color'] == blue) { $color = "blue"; } if($_POST['color'] == green) { $color = "green"; } mysql_query("UPDATE users SET username_color=$color WHERE userid=$userid"); print "Name Color Changed!<br />"; print "<a href='preferences.php'>Back</a>"; }   It does display Name Color Changed! but it doesn't actualy update it. Should be an easy fix, thanks!
×
×
  • Create New...