File size: 1.5Kb
<?php
Defined('ADMIN_S_S') or die ('Доступ запрещен!!!');
$fp = fopen ("news/log/count.txt", "r");
$a = fread($fp, filesize('news/log/count.txt'));
fclose ($fp);
$a = str_replace(')','',$a);
$a = str_replace('(','',$a);
$a = trim($a);
if ($a != 0)
{
while (is_file("news/nov$a.txt"))
{
include ("news/nov$a.txt");
echo "Дата:<br> $data<br>";
echo "Заголовок:<br> $titla<br>";
echo"
<form name='redakt' action='' method='post'>
<input name='id' type='hidden' value='del_news'>
<input name='incl' type='hidden' value='news/nov$a.txt'>
<input type='submit' value='Удалить'>
</form>
";
--$a;
echo '<hr>';
};
}
else
{
echo 'Новостей еще нет.';
};
if ($_POST[incl] != "")
{
unlink("$_POST[incl]");
$f = fopen('news/log/count.txt',"r");
$vsego = fread($f, filesize('news/log/count.txt'));
$vsego = str_replace(')','',$vsego);
$vsego = str_replace('(','',$vsego);
--$vsego;
fclose($f);
$f = fopen('news/log/count.txt',"w");
fwrite($f,"($vsego)");
echo '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/admin.php?int=news/adm/ind.php">';
};
?>