Current Path : /data/web/virtuals/51568/virtual/www/www/uploader/ |
Current File : /data/web/virtuals/51568/virtual/www/www/uploader/uploader-img-smazat.php |
<?php $id = (isset($_POST["id"])) ? $_POST["id"] : 0; if (!isset($pdo)){ require "../../class/pdoDB.class.php"; $pdo = new pdoDB(); } $id = (isset($_POST["id"])) ? $_POST["id"] : 0; $folder = (isset($_POST["folder"])) ? $_POST["folder"] : ""; $query = "select soubory.ext from soubory where soubory.id = :id"; $fotka = $pdo->queryOne($query, Array(':id' => $id)); $cestaKFotce = '../../ftp/galerie'.'/'.$folder.'/'.$id.'.'.$fotka->ext; $malaFotka = '../../ftp/galerie'.'/'.$folder.'/'.$id.'_m.'.$fotka->ext; if (file_exists($cestaKFotce)) unlink($cestaKFotce); if (file_exists($malaFotka)) unlink($malaFotka); $query = "delete from soubory where soubory.id = :id"; $pdo->execute($query, Array(':id' => $id)); ?>