Can you guys correct me if I am wrong here, the drop down box is blank, so I am kinda confused why it's not showing my characters:
Code:
<?php
if( !ereg("index.php", $_SERVER['PHP_SELF']) )
{
header("Location: index.php");
die();
}
showmessage();
if( isset($_POST['changename']) )
{
$type = clean_sql($_POST['type']);
$id = clean_sql($_POST['id']);
$nname = clean_sql($_POST['nname']);
if( $type == "" || $id == "" || $nname == "" )
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
$query01 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$nname'");
if( num_rows($query01) != 0 )
{
setmessage("Name Change", sprintf($_STR[Char23], $nname));
redirect("index.php?do=characters");
die();
}
if( $type == 0 )
{
$query02 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE Name = '$id'");
$part = "Name";
}
elseif( $type == 1 )
{
$query02 = odbc_exec($connection, "SELECT CID FROM {$_CONFIG[CharTable]} WHERE CID = '$id'");
$part = "CID";
}
else
{
redirect("index.php?do=characters");
die();
}
if( num_rows($query02) != 1 )
{
setmessage("Name Change", $_STR[Char24]);
redirect("index.php?do=characters");
die();
}
else
{
odbc_exec($connection, "UPDATE {$_CONFIG[CharTable]} SET Name = '$nname' WHERE $part = '$id'");
writetolog( sprintf($_STR[Log5], $id, $nname) );
setmessage("Name Change", $_STR[Char25]);
redirect("index.php?do=characters");
die();
}
if ($charname != $ownerofcharname)
{
setmessage("Name Change", $_STR[Msg1]);
redirect("index.php?do=characters");
die();
}
}
?>
<br />
<table border="1" style="border-collapse: collapse" id="changename">
<tr><td colspan="2"><b><?php echo $_STR[Char0]; ?></b></td></tr>
<tr><td colspan="2"> </td></tr>
<form method="post" action="index.php?do=characters">
<tr>
<td>
<select size="1" name="cid">
<?
$codigo1 = mssql_query("SELECT Name, CID FROM Character(nolock) WHERE AID = {$_SESSION['AID']} AND CharNum != '-1'");
while( $char = mssql_fetch_array($codigo1) )
{
?>
<option value="<?=$char['CID']?>"><?=$char['Name']?></option>
<?
}
?>
</select> <?php echo $_STR[Char2]; ?>: <input type="text" name="nname" />
<input type="submit" name="changename" value="<?php echo $_STR[Char3]; ?>" />
</td>
</tr>
<tr><td colspan="2"> </td></tr>
</form>
</table>
<br /><br />