Jump to content

World Of Warcraft Private Server - admin modify accounts page


hcns

Recommended Posts

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

AM.PNG

 

 

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

m_a.PNG

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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");
?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>';

Link to comment
Share on other sites

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>';
}

Link to comment
Share on other sites

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

 

a_m.PNG

 

<?

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");
?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.