Location: PHPKode > projects > @1 File Store > control/users/delete.php
<?
if(!isset($_GET["id"]) || $_GET["id"]=="")
{
 exit("Bad request");
}
require_once("const.php");

$smarty->assign("action", $lang['delete_user']);
$form["submit"]=$lang['delete'];
$form["readonly"]=1;
$form["hidden_fields"]=array("id"=>$_GET["id"]);

if($_SERVER["REQUEST_METHOD"]==$form["method"])
{	
 $SQL="DELETE FROM `".DB_PREFIX."users`  WHERE `id`='".$_POST["id"]."'";
 if(!$mysql->query($SQL))
 {
  exit($mysql->error);
 }
 Header("Location:index.php");
 exit();
}else
 {
  $SQL="SELECT * FROM `".DB_PREFIX."users` WHERE `id`='".$_GET["id"]."'";
  if($CurUser->getlevel()>=0)
  {
   $SQL.=" AND (`level`<>0 AND `level`<>-1)";
  }
  if(!$mysql->query($SQL))
  {
   exit($mysql->error);
  }else
   {
    $userform->load($form["fields"], $mysql->arr);
   }
 }

$smarty->assign("form", $form);
$smarty->display("control/form.tpl");
?>
Return current item: @1 File Store