Просмотр файла modules/guestbook/delete.php

Размер файла: 1.28Kb
<?php
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
// Sitchi CMS - Mobile Content Management System //
// The author:  Nikoloz Sitchinava [sitchi]      //
// Link:        http://sitchicms.num.ge          //
// Skype:       SitchiCMS                        //
// License:     LICENSE.txt (see attached file)  //
// Version:     VERSION.txt (see attached file)  //
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
define('_SITCHICMS', 1);
$root_path='../../'; 
require $root_path.'includes/db_connect.php'; //   
require $root_path.'includes/start.php';
require $root_path.'includes/header.php';
require $root_path.'includes/functions.php';
require $root_path.'includes/head.php'; // თავი
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `gb` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `gb` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
if ($user['level']>=2)
{
mysql_query("DELETE FROM `gb` WHERE `id` = '$post[id]'");
}}
if(isset($_GET['delete']))
{
if ($user['level']>=4)
{
mysql_query("TRUNCATE TABLE `gb`");
}}
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL)
header("Location: ".$_SERVER['HTTP_REFERER']);
else
header("Location: index.php?".SID);
?>