Jump to content
MakeWebGames

Royal Guardian

Members
  • Posts

    6
  • Joined

  • Last visited

Royal Guardian's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hey MWG, I am here with a big request which is for someone to re-code the script for me. Much secure and efficient. I tried re-coding it myself however, I am failing with many errors. And it looks like a complete mess. Error at the moment - QUERY 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 Query was SELECT * FROM `users` WHERE `userid` =     <?php require_once('sglobals.php'); echo "<h3><u>Edit User</u></h3>"; $_POST['userid'] = array_key_exists('userid', $_POST) && ctype_digit($_POST['userid']) ? $_POST['userid'] : ''; $_POST['ID'] = array_key_exists('ID', $_POST) && ctype_digit($_POST['ID']) ? $_POST['ID'] : ''; $_GET['ID'] = array_key_exists('ID', $_GET) && ctype_digit($_GET['ID']) ? $_GET['ID'] : ''; if(!isset($_POST['ID'])) { foreach($_POST as $k => $v) { $db->query("UPDATE `users` SET " . $k . " = '" . $v . "' WHERE `userid` = " . $_POST['userid']); } stafflog_add("Edited {$_POST['userid']}"); confirmation("Edited {$_POST['userid']}"); } if(!$_GET['ID'] AND !$_POST['userid']) { echo "Please select the user you wish to edit below.<br/>Some of the edit fields have been disabled and hidden to protect certain details about the user. <table width = '70%' class = 'table' cellpadding = '5' cellspacing = '1'> <tr> <th width = '50%'>Userid</th> <th width = '50%'>Username</th> </tr> <tr> <td style = 'text-align: center;'> <form action = '" . basename($_SERVER['SCRIPT_FILENAME']) . "' method = 'GET'> <input type = 'text' name = 'ID'> <input type = 'submit' value = 'Edit'> </form> </td> <td style = 'text-align: center;'> <form action = '" . basename($_SERVER['SCRIPT_FILENAME']) . "' method = 'GET'> " . user_dropdown($c, 'ID') . " <input type = 'submit' value = 'edit'> </form> </td> </tr> </table>"; } function showTable($variable) { if ($variable === true) { return 'true'; } else if ($variable === false) { return 'false'; } else if ($variable === null) { return 'null'; } else if (is_array($variable)) { $html = "<table width = '80%' class = 'table' cellpadding = '5' cellspacing = '1' style = 'text-align: left;'> <tr><th colspan = '2'>Currently editing user " . $variable['username'] . " [" . $_GET['ID'] . "] <div style = 'float: right;'><a href ='staff_edituser.php'>>Go Back</a></div></th></tr> <tr><th width = '20%' style = 'text-align: left;'>Field</th><th style = 'text-align: left;'>Value</th></tr>"; foreach ($variable as $key => $value) { $value = showTable($value); $hide = array('userpass','pass_salt','profile_signature','user_notepad','forums_signature','user_level','login_name'); if(!in_array($key, $hide)) { $html .= "<tr><td style='text-align: left;'>" . ucfirst($key) . "</td> <td style='text-align: left;'> <input type='text' name='".$key."' value='".$value."' size='70'> </td></tr>"; } } return $html; } else { return strval($variable); } } $ro = $db->query("SELECT * FROM `users` WHERE `userid` = " . $_GET['ID']); if(!$db->num_rows($ro)) { error("No users found"); } $r = $db->fetch_row($ro); echo "<form action='staff_edituser.php' method='post'>"; echo showTable($r); echo "<tr><td colspan = '2'><input type='submit' value='Save new settings'></td></tr></form> </table>"; $h->endpage(); ?>
  2. Anyone can help me create a back and refresh button
  3. Love this! Goes great with my website. Can someone help me out with a back button? Really need this
  4. Thank you all for the replies! Appreciate that you have taken time and replied back. As Kyle was saying there is no point about it. I agree as I made my whole website ajax (http://makewebgames.io/showthread.php/45495-Ajaxify-jQuery-your-Entire-MC-Code-Game-Any-MC-Code-Version) And thanks for the advice about Ajax, jQuery and JSON I am reasearching something new now and will be starting to learn the new web languages. Also what would be the best web languages to start of with? I have started with HTML and PHP fairly good with it. However, not an expert. :) Thanks again!
  5. Hello, I am here in need of help as I need advice or help from someone. I want to make the information of the members to update without them refreshing their browsers. Such as their crystals, money, level, energy bar etc. [ATTACH=CONFIG]2118[/ATTACH] I've seen in a game where the general information update without refreshing however, the bars of the images do not move correctly. Sorry about my English or if I do not make sense.   Good day, and thanks for reading! ~ Guardian
  6. Hey there, May we see your itemuse.php? Also, your item_add & item_remove function which can be found in the global_func.php.
×
×
  • Create New...