Вход Регистрация
Файл: hostbiter.ru/Modules/explode/view/delete.php
Строк: 89
<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
require (
$_SERVER['DOCUMENT_ROOT'].'/Core/fmhead.php');
if(!empty(
$_GET['dir']) AND $_GET['dir'] != encode('www')){
    
$dir htmlspecialchars(trim($_GET['dir']));
}else{
    
$dir encode('www');
}
$fileinfo pathinfo(decode($dir));
if(isset(
$_GET['yes'])){
    
$name htmlspecialchars(trim($_POST['name']));
    
$connect_ftp ftp_connect($config['FTPHost'],21,300);
    
$ftp $db->prepare("SELECT * FROM `ftp_users` WHERE `user` = ? LIMIT 1");
    
$ftp->execute([$user['id']]);
    
$ftp $ftp->fetch();
    
ftp_login($connect_ftp,$ftp['login'],$ftp['password']);
    
ftp_chdir($connect_ftp,'/'.$fileinfo['dirname']);
    
ftp_delete($connect_ftp,$fileinfo['basename']);
    
ftp_close($connect_ftp);
    
$_SESSION['message'] = 'Файл удалён!';
    
header("Location: /explode?dir=".encode($fileinfo['dirname'])."");
    exit;
}
if(isset(
$_GET['no'])){
    
header("Location: /explode?dir=".encode($fileinfo['dirname'])."");
    exit;
}
?>
<style type="text/css"> a.button {   display: block;   float: left;   font: bold 12px arial, sans-serif;   color: #555;   text-decoration: none;   background: url(/image/img/button_r.gif) top right no-repeat;   padding-right: 25px;   outline: none;   position: relative; } a.button span {   display: block;   line-height: 13px;   background: url(/image/img/button_l.gif) no-repeat;   padding: 7px 0 13px 23px; } a.button:hover {   background-position: 100% -33px; } a.button:hover span {   background-position: 0% -33px;   color: #222; } a.button:active, a.button:focus {   background-position: 100% -66px; } a.button:active span, a.button:focus span {   background-position: 0% -66px;   color: #222;   padding: 8px 0 12px 23px; } </style>
        <br /> <center> <div class="mess"> <img src="/image/warning.png" alt="" />  Вы действительно хотите удалить файл <?=$fileinfo['basename']?>?
            <p style="float:right">
                <a class="button" href="/explode/view/delete.php?dir=<?=$dir?>&yes"><span>Да</span></a>  
                <a class="button" href="/explode/view/delete.php?dir=<?=$dir?>&no"><span>Нет</span></a>
            </p> </div> </center>
            <br />
            <div>
                <img src="/image/bf.gif" alt="" /> <a href="/explode?dir=<?=dirname(decode($dir))?>">Назад</a><br />

<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/fmfoot.php');
?>
Онлайн: 0
Реклама