Location: PHPKode > projects > Akasha > folder_delete.php
<?

if ($akashaID == $ID) {
	include ("includes/global.inc"); 	// Global Variables
	include ("includes/functions.inc"); 	// Global Functions

	$user_id = findUserByHash($ID);

	$auth_user = getUserIDMbox($mbox_id);
	$user_id = findUserByHash($ID);
	if ($user_id != $auth_user) {
		Header("Location: main.php?error_code=1");		
	}

  $query = "delete from tblMailBoxes where mbox_id = $mbox_id and user_id = $user_id";
  $result = mysql_db_query("$dbname",$query);
  $query = "select message_id from tblMessages where mbox_id = $mbox_id and user_id = $user_id";
  $result = mysql_db_query("$dbname",$query);
  if($result) {
		while ($r = mysql_fetch_array($result)) {
	 		$message_id = $r["message_id"];
      $query2 = "delete from tblAttachments where message_id = $message_id and user_id = $user_id";
      $result2 = mysql_db_query("$dbname",$query2);
      if($result2) {
    		while ($r = mysql_fetch_array($result2)) {
      	}
      }
		}
	}

  $query = "delete from tblMessages where mbox_id = $mbox_id and user_id = $user_id";
  $result = mysql_db_query("$dbname",$query);
	Header("Location: folders.php?ID=$ID&giris=1");
} else {
		Header("Location: main.php?error_code=1");
}

?>
Return current item: Akasha