Location: PHPKode > projects > VampMan: V:tR Character Manager > vampman-1.0.2/phpnuke/modules/charactersheet/admin/charactersheet/deletecharacter.php
<?php
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }


if($submit == _confirm)
{

$tables = array("characters");

foreach($extra as $key => $values)
{
	array_push($tables, $values['name']."s");
}

foreach($tables as $a)
{
	$deletequery = "DELETE from ".$prefix."_character_".$a." where charid = '$charid'";
	sql_query($deletequery,$dbi);
	//echo $deletequery;

}
echo _chardeleted;
}


else if($submit == _cancel)
{
	echo _charnotdeleted;
}

else{
$query = "Select charid,userid,charname from ".$prefix."_character_characters where charid = '$charid'";

$result = sql_query($query,$dbi) or die(_notresource);
$num = sql_num_rows($result);
if(!$num) echo _nocharacter;

else
{
	$line = sql_fetch_array($result);
	$charname = $line['charname'];

	$queryusername = "select username from ".$prefix."_users where user_id = '".$line['userid']."'";
	$resultusername = sql_query($queryusername, $dbi);
	list($charusername) = sql_fetch_row($resultusername,$dbi);

	echo _user.": $charusername<br>"
."	"._character.": $charname<br>"
."	"._deletesure."<br>";

	echo "<form action=\"admin.php?op=character_deletecharacter\" method=\"post\">"
."	<input type=\"hidden\" name=\"charid\" value=\"$charid\">"
."	<input type=\"submit\" name=\"submit\" value=\""._confirm."\">"
."	<input type=\"submit\" name=\"submit\" value=\""._cancel."\"></form>";
}
}
?>
Return current item: VampMan: V:tR Character Manager