Файл: test.masteram.us/foto_konkurs/delete.php
Строк: 10
<?
include '../Core.php';
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `foto` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$post=mysql_fetch_array(mysql_query("SELECT * FROM `foto` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
unlink(H.'sys/foto/'.$post['id'].'.jpg');
if (isset($user) && ($user['level']>$ank['level'] || $user['level']==4))
mysql_query("DELETE FROM `foto` WHERE `id` = '$post[id]'");
$q=mysql_query("SELECT * FROM `foto` WHERE `id` = '$post[id]'");
}
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL)
header("Location: ".$_SERVER['HTTP_REFERER']);
else
header("Location: index.php?".SID);
?>