Файл: public_html/modules/admin/count.php
Строк: 28
<?php
include_once($_SERVER["DOCUMENT_ROOT"]."/style/head.php");
echo'<title> Счетчики</title>';
@session_start();
if(!isset($admin)){
echo '<div class="error"> <font color="red"> У вас нет прав для просмотра данной страницы</font></div>';
include_once($_SERVER["DOCUMENT_ROOT"]."/style/foot.php");
exit();
}
    if(isset($_POST['okS']))
    {
        foreach ($_POST as $key => $value)
        {
            if(is_file($key))
            {
                $file = fopen($key, "w");
                fwrite($file, $value);
fclose($file);
echo'<div class="success">';
echo $key.' успешно обновленo<br/>';
echo'</div>';
            }
        }
    }
if(isset($admin)){
    echo '<form action="?" method="POST">
Счётчики на главной: (counter)<br/>
<textarea name="counter" cols="44" rows="10">'.file_get_contents("counter").'</textarea><br/>
Счётчики на остальных страницах: (counter_all)<br/>
    <textarea name="counter_all" cols="44" rows="10">'.file_get_contents("counter_all").'</textarea><br/>
    
    <input type="submit" name="okS" value="Обновить">
    </form>
    </div>
';
}else{ echo' <div class="error"> Только админу</div>'; }
include_once($_SERVER["DOCUMENT_ROOT"]."/style/foot.php");
?>