hcns Posted August 14, 2007 Share Posted August 14, 2007 hi all im trying to make a php nuke module for admins of World Of Warcraft Private Server so the admin can manage the account database on website. now my problem i dont know how to make the modify button go to a new page called modify_accounts for the selected account name and bring up all the information on that player only on the new page and so it can be edited by the admin image of manage_accounts page Code of page manage_accounts <?php if (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); } require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); include("header.php"); include("menu.php"); $index=0; $config['mysql_host'] = '******'; // MySql Hostname / IP $config['mysql_user'] = '******'; // MySql Username $config['mysql_pass'] = '******'; // MySql Password $config['mysql_dbname'] = 'wow_accounts'; // Database Name OpenTable(); title("Accounts Manager"); $db = @mysql_connect($config['mysql_host'], $config['mysql_user'], $config['mysql_pass']); if (!$db) return $error[] = 'Database: '.mysql_error(); if (!@mysql_select_db($config['mysql_dbname'], $db)) return $error[] = 'Database: '.mysql_error(); $result = mysql_query("SELECT * FROM accounts"); echo "<table border='1' align=center cellpadding=0 cellspacing=0> <tr> <th>Account Number</th> <th>User Name</th> <th>Game Master Level</th> <th>E Mail Address</th> <th>Modify Player</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<tr><form method='post' action='admin.php?op=manage_accounts&file=modify_accounts'>\n"; echo "<td width=130 align=center>" . $row['acct'] . "</td>"; echo "<td width=130 align=center>" . $row['login'] . "</td>"; echo "<td width=130 align=center>" . $row['gm'] . "</td>"; echo "<td>" . $row['email'] . "</td>"; echo "<td align='center'><select name='op'>\n"; echo "<option value='modify_accounts'>"._MODIFY."</option>\n"; echo "</select><input type='submit' name='submit' value='"._OK."'></td>\n"; echo "</form></tr>\n"; echo "</tr>"; } echo "</table>"; CloseTable(); include("footer.php"); ?> image of modify_accounts setup Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/ Share on other sites More sharing options...
NArc0t1c Posted August 14, 2007 Share Posted August 14, 2007 If they have Userid's then you can use a mysql where clause. Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-323631 Share on other sites More sharing options...
lemmin Posted August 14, 2007 Share Posted August 14, 2007 You can just put a hidden input value for the information you want. If you want acct, change this line from: echo "<td width=130 align=center>" . $row['acct'] . "</td>"; to: echo "<td width=130 align=center>" . $row['acct'] . "<input type=hidden name=acct value=\"" . $row['acct'] . "\"</td>"; Then acct will be in the $_POST array. You can do this will all the variables you want to be passed to the next page. Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-323634 Share on other sites More sharing options...
hcns Posted August 14, 2007 Author Share Posted August 14, 2007 thx all i will give it ago Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-323637 Share on other sites More sharing options...
hcns Posted August 14, 2007 Author Share Posted August 14, 2007 im sorry i have no ider what to do on the modify account page ??? this is the code on the page all the info has to go to <?php if (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); } require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); include("header.php"); include("menu.php"); $index=0; OpenTable(); title("Accounts Modifyer"); <? CloseTable(); include("footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-323686 Share on other sites More sharing options...
lemmin Posted August 14, 2007 Share Posted August 14, 2007 You use the $_POST array like any other array. For the acct hidden input, you would access whatever the value is with $_POST['acct']. Then it is just a normal string variable that you can use to do whatever you want. Try, for example, echo $_POST['acct'] it should be the account name (I assume) that was next to that modify button. Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-323759 Share on other sites More sharing options...
hcns Posted August 15, 2007 Author Share Posted August 15, 2007 i got it to show up on the next page now but i need to get in into the text box so it can be edited by the admin any iders i will tell you now i only just started doing php Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324432 Share on other sites More sharing options...
SirEddie Posted August 15, 2007 Share Posted August 15, 2007 The text box "value" part needs to be a variable of the $_POST['login'], or $_POST['login']. Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324436 Share on other sites More sharing options...
hcns Posted August 15, 2007 Author Share Posted August 15, 2007 thx i will be back with a prob soon Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324483 Share on other sites More sharing options...
hcns Posted August 15, 2007 Author Share Posted August 15, 2007 ok i atm im useing this code to get the information from the manage account page to the modify accounts page <? $variable = $_POST['email']; echo '<input type="text" size="26" name="email" value="' .$variable. '"'; ?> but now i have to do the same thing but make it into an options box so the admin can select Burning Crusade and see Burning Crusade insted of 8 and the other option is Non Burning Crusade but i want to make it so when a admin clicks modify the users account and what ever there account is set to will be at the top of the list Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324543 Share on other sites More sharing options...
SirEddie Posted August 15, 2007 Share Posted August 15, 2007 Try this: if $_POST['flags'] = 0 echo '<select name="flags"><option value="0">Non-Burning Crusade</option><option value="8">Burning Crusade</option>'; else echo '<select name="flags"><option value="8">Burning Crusade</option><option value="0">Non-Burning Crusade</option>'; Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324597 Share on other sites More sharing options...
hcns Posted August 15, 2007 Author Share Posted August 15, 2007 it dont work on this line if $_POST['flags'] = 0 Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324630 Share on other sites More sharing options...
MadTechie Posted August 15, 2007 Share Posted August 15, 2007 php formatted if ($_POST['flags'] == 0) { echo '<select name="flags"><option value="0">Non-Burning Crusade</option><option value="8">Burning Crusade</option>'; }else{ echo '<select name="flags"><option value="8">Burning Crusade</option><option value="0">Non-Burning Crusade</option>'; } Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324635 Share on other sites More sharing options...
hcns Posted August 15, 2007 Author Share Posted August 15, 2007 thanks for the help mad techie it made the page work now but it did not bring there account type in the right order i need it so if there account is Non-Burning Crusade it will show in the list 1st or if there account is Burning Crusade it will show up 1st in the list Non-Burning Crusade = 0 Burning Crusade = 8 <? if (!eregi("admin.php", $_SERVER['SCRIPT_NAME'])) { die ("Access Denied"); } require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); include("header.php"); include("menu.php"); $index=0; $config['mysql_host'] = '******'; // MySql Hostname / IP $config['mysql_user'] = '******; // MySql Username $config['mysql_pass'] = '******; // MySql Password $config['mysql_dbname'] = 'wow_accounts'; // Database Name OpenTable(); title("Accounts Modifyer"); $db = @mysql_connect($config['mysql_host'], $config['mysql_user'], $config['mysql_pass']); if (!$db) return $error[] = 'Database: '.mysql_error(); if (!@mysql_select_db($config['mysql_dbname'], $db)) return $error[] = 'Database: '.mysql_error(); $result = mysql_query("SELECT * FROM accounts"); $result=mysql_query('SELECT * FROM accounts WHERE acct="'.$_GET['acct'].'"'); ?> <html> <head> </head> <body> <table width="43%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="36%" valign="top">Account Number </td> <td colspan="3"><? echo $_POST['acct'] ?></td> </tr> <tr> <td valign="top">User Name</td> <td colspan="3"><? $variable = $_POST['login']; echo '<input type="text" size="26" name="login" value="' .$variable. '"';?></td> </tr> <tr> <td rowspan="3" valign="top">Game Master Level</td> <td colspan="3"><? $variable = $_POST['gm']; echo '<input type="text" size="26" name="gm" value="' .$variable. '"';?></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td valign="top">Last Logon </td> <td colspan="3"><? echo $_POST['lastlogin'] ?></td> </tr> <tr> <td valign="top">Last ip</td> <td colspan="3"><? echo $_POST['lastip'] ?></td> </tr> <tr> <td valign="top">E Mail Account </td> <td colspan="3"><? $variable = $_POST['email']; echo '<input type="text" size="26" name="email" value="' .$variable. '"';?></td> </tr> <tr> <td valign="top">Game Type </td> <td colspan="3"><? if ($_POST['flags'] == 0) { echo '<select name="flags"><option value="0">Non-Burning Crusade</option><option value="8">Burning Crusade</option>'; }else{ echo '<select name="flags"><option value="8">Burning Crusade</option><option value="0">Non-Burning Crusade</option>'; };?> </td> </tr> <tr> <td valign="top"> </td> <td colspan="3"> </td> </tr> <tr> <td valign="top">Password</td> <td colspan="3"> </td> </tr> <tr> <td valign="top">Confirm Password</td> <td colspan="3"> </td> </tr> <tr> <td valign="top">Banned</td> <td width="26%"> </td> <td width="38%"> </td> </tr> </table> <p> </body> <? CloseTable(); include("footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324674 Share on other sites More sharing options...
MadTechie Posted August 15, 2007 Share Posted August 15, 2007 sorry i just fix his code no idea what $_POST['flags'] is refering to? unless i missed a post change if ($_POST['flags'] == 0) { echo '<select name="flags"><option value="0">Non-Burning Crusade</option><option value="8">Burning Crusade</option>'; }else{ echo '<select name="flags"><option value="8">Burning Crusade</option><option value="0">Non-Burning Crusade</option>'; } to if ($row['flags'] == 0) { echo '<select name="flags"><option value="8">Burning Crusade</option><option value="0">Non-Burning Crusade</option>'; }else{ echo '<select name="flags"><option value="0">Non-Burning Crusade</option><option value="8">Burning Crusade</option>'; } EDIT updated Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324686 Share on other sites More sharing options...
hcns Posted August 15, 2007 Author Share Posted August 15, 2007 nah it didn't work but the ider is when a player in the game make an account to loginto the server there is 2 types of game non bc and bc flags is the column where there gametype is stord 0 is for non bc and 8 is for bc if i cant get this to work i wanna make it so the admin that go's on the page can see what account type the player has on the game server but not showing as 0 or 8 <td colspan="3"><? if ($row['flags'] == 0) { echo '<select name="flags"><option value="8">Burning Crusade</option><option value="0">Non-Burning Crusade</option>'; }else{ echo '<select name="flags"><option value="0">Non-Burning Crusade</option><option value="8">Burning Crusade</option>'; }?> </td> </tr> <tr> Quote Link to comment https://forums.phpfreaks.com/topic/64861-world-of-warcraft-private-server-admin-modify-accounts-page/#findComment-324710 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.