Jump to content
MakeWebGames

dementor

Members
  • Posts

    484
  • Joined

  • Last visited

Everything posted by dementor

  1. Re: Cheburn (adam) Torncity People dont look at the bigger picture :-D
  2. Re: Support Needed How can I put the voting site is not posting the ID hence why it is an error saying nothing was inputted So I need to check my URL from the voting site get what I am saying now ?
  3. Re: [review]Serious Wars I did that before :P
  4. Re: Support Needed I think the error is more the code being used to go vote
  5. Re: Support Needed BTW the I already knew that was the problem im asking where I have gone wrong in the code !
  6. Re: Support Needed The error is not in one of the queries just in the event add
  7. Re: Support Needed Wrong answer mate
  8. I decided today to make a script for voting on my site   <?php session_start(); include "mysql.php"; include "global_func.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(); $user=$_POST['userid']; $q=mysql_query("SELECT * FROM votes WHERE userid='$user' AND list='toprpg'",$c); if(mysql_num_rows($q)) { event_add($_POST['userid'],"You voted today already.",$c); } else { event_add($_POST['userid'],"Well done for voting keep it up.",$c); mysql_query("UPDATE users SET crystals=crystals+1 WHERE userid='$user'"); mysql_query("INSERT INTO votes values ('$user','toprpg')",$c); } ?>   That is what I come up with and I get the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Im clueless where that error is comeing from do you ?
  9. Re: [review]Serious Wars You know was funny my game has more active players than yours xD I should be advising you fool
  10. Re: [review]Serious Wars Are you going to review the game or tell me stuff I already know -_- I will only ever move hosts if I am resetting no other time and I wont be resetting So dont post here unless you are reviewing thank you.
  11. Re: [review]Serious Wars I got 2 real domains already Im not using them >.> I like that one and I like to have a free host -_- www.seriouswars.net
  12. Re: Item Market Problem??? You have two functions doing the same thing delete one
  13. This game has been going for a while im just wondering what you guys think of the game really http://www.seriouswars.net
  14. Re: Free 2 - Icons screen shot ?
  15. Re: Main Menu is in ya header.php
  16. dementor

    Error

    Re: Error   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); $sql = sprintf("SELECT * FROM `gangs` WHERE (`gangID` = %u)", @intval($_POST['gang'])); $gq = mysql_query($sql) or die(mysql_error()); $gangdata=mysql_fetch_array($gq); 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(); if($ir['user_level']!= 2) { print "Get out of here, dude."; exit; } switch($_GET['action']) { case "name": name(); break; case "delete": delete(); break; case "delete2": delete2(); break; case "wars": wars(); break; case "respect": respect(); break; case "members": members(); break; case "apps": apps(); break; case "bank": bank(); break; case "ann": ann(); break; case "tag": tag(); break; case "kick": kick(); break; case "armory": armory(); break; case "uarmory": uarmory(); break; case "desc": desc(); break; case "logo": logo(); break; case "pres": pres(); break; case "id": id(); break; case "mw": mw(); break; default: index(); break; } function index() { global $ir,$c,$userid,$h,$gangdata; print "[b]You are managing gang {$gangdata['gangNAME']} ({$_POST['gang']}).[/b] >[url='gangadmin.php?action=name']Change Name[/url] >[url='gangadmin.php?action=delete']Delete this Gang[/url] >[url='gangadmin.php?action=wars']Delete all Gang Wars with this Gang[/url] >[url='gangadmin.php?action=respect']Change Respect[/url] >[url='gangadmin.php?action=members']Memberlist[/url] >[url='gangadmin.php?action=apps']Applications[/url] >[url='gangadmin.php?action=bank']Bank[/url] >[url='gangadmin.php?action=ann']Change Annoucement[/url] >[url='gangadmin.php?action=tag']Change Tag[/url] "; if($gangdata['gangARMORY']== 1) { print ">[url='gangadmin.php?action=armory']Lock Armoury[/url] "; } else { print ">[url='gangadmin.php?action=uarmory']Unlock Armoury[/url] "; } print ">[url='gangadmin.php?action=desc']Change Description[/url] >[url='gangadmin.php?action=logo']Change Logo[/url] >[url='gangadmin.php?action=pres']Change President / Vice President[/url] >[url='gangadmin.php?action=id']Change Gang ID[/url] >[url='gangadmin.php?action=mw']Manage Gang Wars[/url] "; } function name() { global $ir,$c,$userid,$h,$gangdata; if($_POST['gangname']) { $ct=mysql_query("SELECT * FROM gangs WHERE gangNAME={$_POST['gangname']}",$c); if(mysql_num_rows($ct)) { print "Name Taken [url='gangadmin.php?action=name']Back[/url] "; exit; } mysql_query("UPDATE gangs SET gangNAME={$_POST['gangname']} WHERE gangID={$gangdata['gangID']}",$c); print "Name Changed to {$_POST['gangname']} [url='gangadmin.php?ID={$gangdata[']Back[/url] "; } else { print "Please enter the new name you would like this gang to be <form action='gangadmin.php?action=name' method='post'> New Name :<input type='text' name='gangname' value='{$gangdata['gangNAME']}'> <input type='submit' value='New Name'> </form>"; exit; } } function delete() { global $ir,$c,$userid,$h,$gangdata; print "Are you 100% sure you want to delete the {$gangdata['gangNAME']} gang? [url='gangadmin.php?action=delete2']Yes, i want to delete it now[/url] [url='gangadmin.php?ID={$gangdata[']No, keep it[/url] "; } function delete2() { global $ir,$c,$userid,$h,$gangdata; mysql_query("DELETE FROM gangs WHERE gangID={$gangdata['gangID']}",$c); print "Gang Deleted [url='admin.php']Back to admin home[/url] "; } function wars() { global $ir,$c,$userid,$h,$gangdata; mysql_query("DELETE FROM gangwars WHERE warDECLARED={$gangdata['gangID']} OR warDECLARER={$gangdata['gangID']}",$c); print "All Gang Wars Deleted with this gang."; } function respect() { global $ir,$c,$userid,$h,$gangdata; if($_POST['respect']) { $respect=abs((int) $_POST['respect']); mysql_query("UPDATE gangs SET gangRESPECT=$respect WHERE gangID={$gangdata['gangID']}",$c); print "Respect Changed!"; } else { print "[b]Enter the new amount of respect for this gang.[/b] <form action='gangadmin.php?action=respect'> New Respect : <input type='text' name='respect' value='{$gangdata['gangRESPECT']}'> <input type='submit' value='Change!'> </form> "; } } function members() { global $ir,$c,$userid,$h,$gangdata; $gmq=mysql_query("SELECT * FROM users WHERE gang={$gangdata['gangID']}",$c); print "Viewing members of the {$gangdata['gangNAME']} gang <table width=100% border=0><tr><th>Username</th><th>Days in Gang</th><th>Kick?</th></tr>"; while($m=mysql_fetch_array($gmq)) { print "<tr><td>[url='viewuser.php?u={$m[']{$m['username']}[/url] [{$m['userid']}]</td><td>{$m['daysingang']}</td><td><a href='gangadmin.php?action=kick&userid={$m['userid']}'>Kick</td></tr>"; } print "</table> "; } function kick() { global $ir,$c,$userid,$h,$gangdata; $kickwho=(int) $_GET['userid']; mysql_query("UPDATE users SET gang=0,daysingang=0 WHERE userid=$kickwho",$c); print "$kickwho has been kicked out of the {$gangdata['gangID']} gang."; } function apps() { global $ir,$c,$userid,$gangdata,$h; $_GET['app'] = abs((int) $_GET['app']); if($_GET['app']) { $aq=mysql_query("SELECT a.*,u.* FROM applications a LEFT JOIN users u ON a.appUSER=u.userid WHERE a.appID={$_GET['app']} AND a.appGANG={$gangdata['gangID']}",$c); if (mysql_num_rows($aq)) { $appdata=mysql_fetch_array($aq); if($_GET['what'] == 'decline') { mysql_query("DELETE FROM applications WHERE appID={$_GET['app']}",$c); event_add($appdata['appUSER'],"Your application to join the {$gangdata['gangNAME']} gang was declined",$c); print "You have declined the application by {$appdata['username']} to the {$gangdata['gangNAME']} gang. [url='gangadmin.php?action=apps']> Back[/url]"; } else { $cnt=mysql_query("SELECT username FROM users WHERE gang={$gangdata['gangID']}",$c); if($gangdata['gangCAPACITY'] == mysql_num_rows($cnt)) { print "Your gang is full, you must upgrade it to hold more before you can accept another user!"; $h->endpage(); exit; } else if ($appdata['gang'] != 0) { print "That person is already in a gang."; $h->endpage(); exit; } mysql_query("DELETE FROM applications WHERE appID={$_GET['app']}",$c); event_add($appdata['appUSER'],"Your application to join the {$gangdata['gangNAME']} gang was accepted, Congrats!",$c); mysql_query("UPDATE users SET gang={$gangdata['gangID']},daysingang=0 WHERE userid={$appdata['userid']}",$c); print "You have accepted the application by {$appdata['username']} to the {$gangdata['gangNAME']} gang. [url='gangadmin.php?action=apps']> Back[/url]"; } } } else { print "[b]{$gangdata['gangNAME']}'s Applications[/b] <table width=85% border=2><tr style='background:gray;'><th>User</th><th>Level</th><th>Money</th><th>Reason</th> <th> </th></tr>"; $q=mysql_query("SELECT a.*,u.* FROM applications a LEFT JOIN users u ON a.appUSER=u.userid WHERE a.appGANG={$gangdata['gangID']}",$c); while($r=mysql_fetch_array($q)) { print "<tr><td>[url='viewuser.php?u={$r[']{$r['username']} [{$r['userid']}][/url]</td><td>{$r['level']}</td><td>\${$r['money']}</td> <td>{$r['appTEXT']}</td><td><a href='gangadmin.php?action=apps&app={$r['appID']}&what=accept'> Accept</a> | <a href='gangadmin.php?action=apps&app={$r['appID']}&what=decline'> Decline</a></td></tr>"; } print "</table>"; } } function bank() { global $ir,$c,$userid,$h,$gangdata; if($_POST['givewho']) { if($_POST['bankmoney'] > $gangdata['gangBANKMONEY'] || $_POST['bankcrystals'] > $gangdata['gangBANKCRYSTALS']) { print "This gang does not have that much cash/crystals funds to give out [url='gangadmin.php?action=bank']>Back[/url] "; exit; } else { $money=(int) $_POST['bankmoney']; $cryst=(int) $_POST['bankcrystals']; $themid=(int) $_POST['userid']; mysql_query("UPDATE gangs SET gangBANKMONEY=gangBANKMONEY-$money, gangBANKCRYSTALS=gangBANKCRYSTALS-$cryst WHERE gangID={$gangdata['gangID']}",$c); mysql_query("UPDATE users SET money=money+$money, crystals=crystals+$cryst WHERE userid=$themid",$c); print "You gave \${$_POST['bankmoney']} cash and {$_POST['bankcrystals']} crystals to userid: {$_POT['userid']}"; } } else { print "[b]Here is {$gangdata['gangNAME']}'s bank[/b] [b]\${$gangdata['gangBANKMONEY']} cash[/b] [b]{$gangdata['gangBANKCRYSTALS']} crystals[/b] <hr width=50% /> <form action='gangadmin.php?action=bank' method='post'> Userid :<input type='text' name='userid' value=''> Bank Cash: <input type='text' name='bankmoney' value='{$gangdata['gangBANKMONEY']}'> Bank Crystals : <input type='text' name='bankcrystals' value='{$gangdata['gangBANKCRYSTALS']}'> <input type='submit' value='Submit'> </form>"; } } function ann() { global $ir,$c,$userid,$h,$gangdata; if($_POST['ann']) { mysql_query("UPDATE gangs SET gangANNOUCEMENT='{$_POST['ann']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Annoucement Changed!"; } else { print "[b]Here you are changing the gang annoucement[/b] <form action='gangadmin.php?action=ann' method='post'> New Annoucement : <textarea name='ann' cols='30' rows='11'>{$gangdata['gangANNOUCEMENT']}</textarea> <input type='submit' value='Change Annoucement!'> </form>"; } } function tag() { global $ir,$c,$userid,$h,$gangdata; if($_POST['tag']) { mysql_query("UPDATE gangs SET gangPREFIX='{$_POST['tag']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Tag Changed!"; } else { print "[b]Here you are changing the gang's tag[/b] <form action='gangadmin.php?action=tag' method='post'> New Tag : <input type='text' name='tag' value='{$gangdata['gangPREFIX']}'> <input type='submit' value='Change Tag!'> </form>"; } } function armory() { global $ir,$c,$userid,$h,$gangdata; mysql_query("UPDATE gangs SET gangARMORY=0 WHERE gangID={$gangdata['gangID']}",$c); print "Gangs Armory is now locked. "; } function uarmory() { global $ir,$c,$userid,$h,$gangdata; mysql_query("UPDATE gangs SET gangARMORY=1 WHERE gangID={$gangdata['gangID']}",$c); print "Gangs Armory is now unlocked. "; } function desc() { global $ir,$c,$userid,$h,$gangdata; if($_POST['desc']) { mysql_query("UPDATE gangs SET gangDESCRIPTION='{$_POST['desc']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Description Changed!"; } else { print "[b]Here you are changing the gang's description[/b] <form action='gangadmin.php?action=desc' method='post'> New Description : <input type='text' name='desc' value='{$gangdata['gangDESCRIPTION']}'> <input type='submit' value='Change Decription!'> </form>"; } } function logo() { global $ir,$c,$userid,$h,$gangdata; if($_POST['logo']) { mysql_query("UPDATE gangs SET gangLOGO='{$_POST['logo']}' WHERE gangID={$gangdata['gangID']}",$c); print "Gang's Logo Changed!"; } else { print "[b]Here you are changing the gang's logo[/b] <form action='gangadmin.php?action=logo' method='post'> New Logo : <input type='text' name='logo' value='{$gangdata['gangLOGO']}'> <input type='submit' value='Change Logo!'> </form>"; } } function pres() { global $ir,$c,$userid,$h,$gangdata; if($_POST['pres'] || $_POST['vicepres']) { if($_POST['pres']) { $pres=(int) $_POST['pres']; } if($_POST['vicepres']) { $vicepres=(int) $_POST['vicepres']; } mysql_query("UPDATE gangs SET gangPRESIDENT=$pres, gangVICEPRES=$vicepres WHERE gangID={$gangdata['gangID']}",$c); print "Gang's President and Vice President Changed!"; } else { print "[b]Here you are changing the gang's president/vice president. leave blank for no change.[/b] <form action='gangadmin.php?action=pres' method='post'> New President : <input type='text' name='pres' value='{$gangdata['gangPRESIDENT']}'> New Vice-President : <input type='text' name='vicepres' value='{$gangdata['gangVICEPRES']}'> <input type='submit' value='Change!'> </form>"; } } function id() { global $ir,$c,$userid,$h,$gangdata; if($_POST['newid']) { $nid=(int) $_POST['newid']; $lid=(int) $_POST['lastid']; $ncq=mysql_query("SELECT * FROM gangs WHERE gangID=$nid",$c); if(mysql_num_rows($ncq)) { print "Gang ID Taken. [url='gangadmin.php?action=id']>Back[/url] "; exit; } mysql_query("UPDATE users SET gang=$nid WHERE gang=$lid",$c); mysql_query("UPDATE gangwars SET warDECLARED=$nid WHERE warDECLARED=$lid",$c); mysql_query("UPDATE gangwars SET warDECLARER=$nid WHERE warDECLARER=$lid",$c); mysql_query("UPDATE gangarmory SET armoryGANGID=$nid WHERE armoryGANGID=$lid",$c); mysql_query("UPDATE gangs SET gangID=$nid WHERE gangID=$lid",$c); print "Gang ID Changed! [url='index.php']Home[/url] "; } else { print "Type in the new gang ID for this gang ID. <form action='gangadmin.php?action=id' method='post'> <input type='hidden' name='lastid' value='{$gangdata['gangID']}'> New ID : <input type='text' name='newid'> <hr width=40% /> [b]Are you 100% sure you want to change the Gang's ID?[/b] <input type='submit' value='Yes'> <input type='reset' value='No'> </form>"; } } function mw() { global $ir,$c,$userid,$h,$gangdata; if($_GET['delete']) { $delete=(int) $_GET['delete']; mysql_query("DELETE FROM gangwars WHERE warID=$delete",$c); print "Successfully Deleted =D. "; } else { $gwq=mysql_query("SELECT gw.*,g.* FROM gangwars gw LEFT JOIN gangs g ON gw.warDECLARED=g.gangID OR gw.warDECLARER=g.gangID WHERE gw.warDECLARED={$gangdata['gangID']} OR gw.warDECLARER={$gangdata['gangID']}",$c); print "[b]Viewing all wars with {$gangdata['gangNAME']} gang.[/b] <table width=100% border=0><tr><th>War ID</th><th>Gang Declarer</th><th>Delete War?</th></tr>"; while($wq=mysql_fetch_array($gwq)) { print "<tr><td>{$wq['warID']}</td><td>[url='gangs.php?action=view&ID={$wq[']{$wq['gangNAME']}[/url] ({$wq['gangID']})</td><td>[[url='gangadmin.php?action=mw&delete={$wq[']Delete[/url]] </td></tr>"; } print "</table>"; } } $h->endpage(); ?>
  17. dementor

    Error

    Re: Error Nyna My point was why secure a code that it isnt working yet xD
  18. dementor

    Error

    Re: Error The initial error has been removed but this one last post I made still gives ou the saqme erro
  19. dementor

    Error

    Re: Error   function name() { global $ir,$c,$userid,$h,$gangdata; if($_POST['gangname']) { $ct=mysql_query("SELECT * FROM gangs WHERE gangNAME={$_POST['gangname']}",$c); if(mysql_num_rows($ct)) <<<<<< Line 87 { print "Name Taken [url='gangadmin.php?action=name']Back[/url] "; exit; } mysql_query("UPDATE gangs SET gangNAME={$_POST['gangname']} WHERE gangID={$gangdata['gangID']}",$c); print "Name Changed to {$_POST['gangname']} [url='gangadmin.php?ID={$gangdata[']Back[/url] "; } else { print "Please enter the new name you would like this gang to be <form action='gangadmin.php?action=name' method='post'> New Name :<input type='text' name='gangname' value='{$gangdata['gangNAME']}'> <input type='submit' value='New Name'> </form>"; exit; } }   The actual code up there works fine is when i want to use a function that the codes start to play up Heres a function here No talk of sql injection please or securing code I just want to know the problem Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/***/public_html/***.php on line 86 Name Changed to dasada Back there is the error once I change the name and is only after I enter this page I get the error which I posted up there
  20. dementor

    Error

    Re: Error well if my admins are going to sql inject me as it is something for my admins then Ill take the risk
  21. dementor

    Error

    Re: Error   $gq=mysql_query("SELECT * FROM gangs WHERE gangID={$_POST['gang']}",$c); $gangdata=mysql_fetch_array($gq);   there is the line of code I see nothing worng
  22. dementor

    Error

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/**************/public_html/**********.php on line 20 Anyone care to explain this what this error means in general So ill be able to fix my code thanks :)
  23. Re: Burn House for V2   <?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(); if($ir['energy'] < $ir['maxenergy']) { die("Sorry, it is required you have full energy when attempting to burn a house down."); } if($ir['brave'] < $ir['maxbrave']) { die("Sorry, it is required you have full brave when attempting to burn a house down."); } if($ir['hospital']) { die("You cannot Burn a House while in hospital."); } if($_GET['ID'] == $userid) { die("I dont think you want to fo that."); } $q=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}",$c); if(mysql_num_rows($q) == 0) { //Error message// print "[b]<font color='red'>ERROR:[/b]</font> Invalid User ID. [url='index.php']-Go Home[/url]"; } $mult=$r['level']*$r['level']; $chance= rand (1,100); if (30 > $chance) { print "You successfully Burned {$r['username']} Home Down [url='index.php']Back[/url]"; mysql_query("UPDATE users SET exp=exp+{$mult} WHERE userid=$userid",$c); mysql_query("UPDATE users SET will=0 WHERE userid={$r['userid']}",$c); mysql_query("UPDATE users SET brave=0 WHERE userid=$userid",$c); mysql_query("UPDATE users SET energy=0 WHERE userid=$userid",$c); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] Burned your House Down.", $c); } else { print "You arrive at the house and walk in you pour the gas on the floor and set the light. You here a noise suddenly and drop the lighter and set fire to yourself! [url='hospital.php']Go to Hospital[/url]"; mysql_query("UPDATE users SET hospital=75, hospreason='Set fire to themselves.' WHERE userid=$userid",$c); mysql_query("UPDATE users SET brave=0 WHERE userid=$userid",$c); mysql_query("UPDATE users SET energy=0 WHERE userid=$userid",$c); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] burnt themself trying to burn your house.", $c); } $h->endpage(); ?>   Works to a certain extent but still something needs twigging PS hoping someone reposts it working PSS V1
  24. Re: Hospital Time I take that back great mod :)
  25. Re: [Free] MySQL Control Panel would be nice to get a little list of the fields in tables As in if you wanted to check something in itemselllogs The user field isnt necessary ID so you will still need to check in DB what you were looking for So like a drop down list of the fields would be nice
×
×
  • Create New...