View Single Post
  #4  
Old 3rd August 2008, 13:47
johnake's Avatar
johnake johnake is offline
Senior Member
 
Join Date: Dec 2007
Posts: 52
Default
Try this one:
PHP Code:
<?
require "include/bittorrent.php";
dbconn();

if (
get_user_class() < UC_ADMINISTRATOR)
stderr("Sorry""Permission denied.");

if (
$HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
 
$username trim($_POST["username"]);

if (!
$username)
   
stderr("Error""Please fill out the form correctly.");

 
$res mysql_query(

 
"SELECT * FROM users WHERE username=" sqlesc($username)   ) or sqlerr();
 if (
mysql_num_rows($res) != 1)
   
stderr("Error""Bad user name or password. Please verify that all entered information is correct.");
 
$arr mysql_fetch_assoc($res);

 
$id $arr['id'];
 
$res mysql_query("DELETE FROM users WHERE id=$id") or sqlerr();
 if (
mysql_affected_rows() != 1)
   
stderr("Error""Unable to delete the account.");
 
stderr("Success""The account <b>$username</b> was deleted.");
}
stdhead("Delete account");
?>
<h1>Delete account</h1>
<table border=1 cellspacing=0 cellpadding=5>
<form method=post action=delacctadmin.php>
<tr><td class=rowhead>User name</td><td><input size=40 name=username></td></tr>

<tr><td colspan=2><input type=submit class=btn value='Delete'></td></tr>
</form>
</table>
<?
stdfoot
();
?>
__________________
PHP Code:
class mySelf extends World
   
{
       public 
$health;
       private 
$friends;
       protected 
$love;
  
   public function 
__construct()
  {
       
$this->health 100;
       
$this->friends 2;
       
$this->love true;
  }
  protected function 
__love()
  { 
      
//has a bug... for the moment...
      //will fix it later.. until then:
      
sleep(15*365*24*3600);
  }

Reply With Quote