Jump to content
MakeWebGames

War_Hero

Members
  • Posts

    232
  • Joined

  • Last visited

Everything posted by War_Hero

  1. The lines above and below the green and red snipets: <?php include "admin_globals_test.php"; $ad_password = ("SELECT t_password FROM administrators"); $apass = mysql_query($ad_password); $p = mysql_fetch_assoc($apass); $select_admin = ("SELECT * FROM test_users WHERE user_level = 1"); $run_admin = mysql_query($select_admin) OR die(mysql_error()); $select_users = ("SELECT ID, forename, surname, login_name FROM test_users WHERE user_level != 1"); $run_users = mysql_query($select_users) OR die(mysql_error()); $count_users = mysql_num_rows($run_users); switch($_GET['action']) { case 'submit': submit(); break; default: index(); break; } And the lines above and below the blue snipet: function index() { global $db, $ud, $uID; print " <h3 />Change User Level</h3> <hr /> Here you can change the user level of a member to make them an administrator. Below is a list of the current administrators and a list of the current users. <table width = '70%' class = 'table2' /> <tr /> <th />ID</th> <th />Forename</th> <th />Surname</th> <th />Login Name</th> </tr>"; while($ad = mysql_fetch_assoc($run_admin)) { print " <tr /> <td />{$ad['ID']}</td> <td />{$ad['forename']}</td> <td />{$ad['surname']}</td> <td />{$ad['login_name']}</td> </tr>"; } Both include the snipets posted in the first post. I can't see what's wrong. Maybe I've been looking at it for too long, I don't know.
  2. Hi all. I've had a problem with a query or two, and I don't understand what's wrong. I've tried all that I know to fix it. But to me, the queries look correct. I'm getting this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in/usr/home/*****/domains/**********/public_html/changeuser.php on line 39   These are the lines I believe are causing the error:   $select_admin = ("SELECT * FROM test_users WHERE user_level = 1"); $run_admin = mysql_query($select_admin) OR die(mysql_error()); and then further down the script: while($ad = mysql_fetch_assoc($run_admin)) {   Before you ask, I have got a table called test_users, and a field called user_level. And there is at least one user in there who has a user_level of 1. :P Could someone please explain to me what is wrong with the above queries, or what I am missing? Other queries in my script are structured like this and work perfectly. Any help will be highly appreciated. Thank you. :)
  3. Hi all. I'm pretty new to Javascript and have a little problem. On my website, an admin can either select to Accept or Decline a registration from another user, but they cannot do both. Therefore, to prevent the situation of them accidentally selecting both check boxes, I need one of them to be disabled. For example, when the admin ticks the Accept box, the Decline box becomes disabled, and vice versa. I have tried a few things using info I've found on the web, but haven't had any success. So far, this is what I have: <html> <head> <script language = "javascript"> function setAccept() { var flag = document.subchoice.accept; flag2 = document.subchoice.decline; flag.checked = true; if(flag.checked == true) { flag2.disabled = true; } } function setDecline() { var flag = document.subchoice.decline; flag2 = document.subchoice.accept; flag.checked = true; if(flag.checked == true) { flag2.disabled = true; } } </script> </head> </html> And the PHP form: else { while ($sreg = mysql_fetch_assoc($runreg)) { print " {$sreg['forename']} {$sreg['surname']} {$sreg['gender']} {$sreg['form']} {$sreg['dob']} {$sreg['year']} {$sreg['login_name']} "; } I will, in the end, need to store the accepted registrations in my database, but I will focus on that once I have solved this problem. I've probably done the Javascript bit wrong...I'm new to this. So any help will be highly appreciated. Thank you. :)
  4. War_Hero

    $end issue

    Thank you for you help. :) I'll make sure I remember that when using them again.
  5. War_Hero

    $end issue

    Thank you very much. Removing the tabs before the OUT; solved my problem. :) Does the same apply to EOF; or is it just OUT; EOT; etc? Thanks again for the help. It's very much appreciated.
  6. War_Hero

    $end issue

    Spaced out. It was the php tags that put it onto two lines. "/ Hmmm
  7. War_Hero

    $end issue

    Hi all. It's been an age since I last posted on here or did any PHP...and annoyingly, I've lost some of it and I need to rebuild my skills. "/ I'd usually be able to solve most problems, but I can't get round this $end issue. It's p*ssing me right off, and I've tried all that I can. I'm getting this error: Parse error: syntax error, unexpected $end in /usr/home/****/domains/*******/public_html/header_test.php on line 117 Below is the code for this script (it's not too long): <?php class headers {function startheaders() {global $ud, $set;print <<<EOF<!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 /><meta http-equiv = "Content-Type" content = "text/html; charset = iso-8859-1" /><title />R.E.R | Home</title><style type = 'text/css' /></style></head><body><center><table width = '970' border = '0' cellpadding = '0' cellspacing = '0' class = 'bigtable' /><tr /><td />EOF;}function userdata($ud,$qs,$ts) {global $db, $uID, $set, $staffpage;print <<<OUT<img src = 'newbanner.jpg' alt = 'R.E.R Site' width = '100%' height = '100px' /> // <table width = '100%' border = '0' cellpadding = '0' cellspacing = '0' /><tr /><td width = '20%' valign = 'top' /> [b]Login Name:[/b] {$ud['login_name']} [b]Num of questions answered:[/b] {$qs} [b]Total Score:[/b] {$ts}<hr />OUT;}function menuarea() {include "mainmenu_test.php";global $ud,$c;print "</td> <td width = '2' /></td><td width = '80%' <center>[b]If you have any questions, please contain Ms O\'Hare at Lorraine.o\'[email protected][/b]";}function endpage() {global $db;print <<<OUT</center></td></tr></table></td></tr></table></center></body></html>OUT;}}?> I really wish I could figure this out, but I've done all I can. Any help with this will be highly appreciated. :) Thank you.
  8. Re: Function help Thank you very much. :) I had to tweak a few things afterwards to get it to work, but it works. :)
  9. Re: Function help I think you can because the exact same method is used in the script yourgang.php. Within the gang_staff() function, there are other functions, like declaring war, managing the gang vault, etc. So I'm confused...what is the difference with what I'm doing?
  10. Re: Function help Ahh yeah, that would be helpful, wouldn't it? :) Here is function furnidx(): function furnidx() { global $db,$ir,$c,$h,$userid,$house,$userhouse,$house_settings; print "Hello. Please select an option from below: <font color = blue /><a href = '{$_SERVER['PHP_SELF']}?action=buyfurniture&act2=furnlist' />Buy Furniture</a></font>"; }   That is within the function buy_furniture().
  11. Re: Function help Nobody? :| I know it may seem like an elementary question/problem, but I just can't solve it. I usually don't ask for help, but as I've just come back into coding, I need some, just to solve this little problem. :)
  12. Hi all. :) I haven't posted on here in some time, as I stopped coding for a few months due to exams. Now that I've got back into coding again, I need to refresh my memory...as such. I've been on working on a mod and have come across an error, which seems like a simple one but I can't figure it out, yet I've racked my mind for a solution yet can't find one. This is the error I'm getting: Fatal error: Call to undefined function furnidx() in /usr/home/*****/domains/*****/public_html/housing.php on line 168 Here is the area of code which is causing me hassle:   function buy_furniture() { global $db,$ir,$c,$h,$userid,$house,$userhouse,$house_settings; if($db->num_rows($house) > 0) { switch($_GET['act2']) { case 'idx': furnidx(); break; case 'furnlist': furn_list(); break; case 'buy': buy(); break; default: furnidx(); break; (this is line 168) } } else { die("You don't have a house. <a href = 'index.php' />Go Back</a>"); }   Before any of you say it, yes, I do have a function for each of the defined ones above. :) But for some reason I'm getting this error. Could anyone explain to me what I can do to sort this out, please? If you need me to post more of the code, I will. Any help will be greatly appreciated. :)
  13. Re: Help Please Very Urgent Your best bet is to take yourself out of fed jail via PHPMYADMIN, and then de-staff your ex-friend via PHPMYADMIN as well. ;) And possibly make it so that you can't be fedded or de-staffed. That's what I did to save that sort of hassle. :)
  14. Re: [mccode v2] Humans vs. Zombies EVENT mod [done, v1.0] Very well thought out and coded mod. I've yet to try it out, but I'm pretty sure it's great. :) It's nice to see a different idea that strays away from the gangster/hitman approach.
  15. Re: Businesses Mod [Mccode V2] The & and • are HTML entities. The first one is the ampersand sign, &. The second entity is a rounded bullet point. :)
  16. Re: [Request] Gang Addon You must take into consideration the theme of the game. For example, if the game is a hacking based game, the gangs may well be hackers, with different positions to be: Security Advisor, Chief Hacker, etc. I'm just thinking of things off the top of my head now. :) I like the idea. If it is like the normal Hack PC, then it wouldn't be too hard to make. :)
  17. Re: [mccode v2] Burn House   Are you just going onto burnhouse.php? Try going onto burnhouse.php?ID=1 and see if you get the same message. :)
  18. Re: A standalone Mug mod The Hack PC option will allow the user to steal another user's on-hand money and crystals. If the hacking user does not have enough brave, they can not hack. :) The config file will allow you to alter details, for example: the brave required for each hack, which userids can't be hacked, etc. If I weren't in school, I'd post some screen shots. ;) But I'm boring my arse off in Photography. :-P
  19. Re: A standalone Mug mod Well, I'm not sure about a stand alone mug mod, but there's a Hack User's PC mod. :)
  20. Re: [mccode v2] Club Mod (my version) I'm glad you all like it. :) And thank you for the comments. :) I may be improving this and making it more advanced and may sell the newer version, but I'm yet to decide. I'm currently working on a larger project which is taking up a lot of time. :-P
  21. Re: [mccode v2] Lottery If you're already got a cron_weekly.php, then you can just add this cron at the bottom of it before the ?>. You may need to change a few variables and values, but I'm not sure. :)
  22. Re: Have any mod ideas post here!   I like these ideas. :)   I made something like that, but it was a Build Gym feature, where the user could choose from three different sized gyms to build. They'd need cement and bricks to build the gym, and then would need to buy insurance. Then, they can train in their gym. All three gyms are better than the normal gym. I'm contemplating on making it more advanced and selling it.   I think that would be quite easy. Maybe add a small query in the Travel Agency or on Explore (or anywhere you like) that checks to see if the required item is in the inventory. If it isn't, the page produces a die() statement.   Overall, some very good ideas there. :) I may attempt one or two of them later after I've finished my current 'project'. :)
  23. Re: Logged in error Fack sake! :-P Thank you for your help. :) I've fixed it now. S'all good. It was the damn newspaper. Grr. :)
  24. Hi all. :) My brother and I decided to reset our game for several reasons and truncated all the tables and closed down login and register while we fix things up. I signed up, activated my account. And now whenever I log in, I get this error: Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 13 in /usr/home/*****/domains/*************/public_html/class/class_db_mysql.php on line 94 We haven't got this error before. :? If need be, I shall post line 94 and the surrounding lines of the file. Might it be that we 'shut' the game down, effectively 'shutting down' the crons (as they didn't work while the game was under password protection)? But the thing is, the crons seem to be working fine, so I don't think it's that. This error is located under the Your last visit was: blah. And I can still 'play' the game with no errors. It just appears on the logged in page.... Could someone please explain to me what the error means and guide me in the right direction? I will also be searching the web as well, to try and figure it out myself. ;) Any help will be highly appreciated. :)
  25. Re: [mccode v2] Club Mod (my version)   Thanks. Glad you like it. :)   I'm not sure why you're getting that error. It works fine for me. Did you alter anything?
×
×
  • Create New...