Mini Shell
<?
include"menu.php";
switch ($permissao)
{
case "2":
break;
default:
echo "<script>
alert('sem permissão! ');
</script>";
exit();
break;
}
$id = $_POST["idnoticia"];
$antigo = $_POST["antigo"];
$id = base64_decode($id);
$id = base64_decode($id);
$antigoo = "/home/sicomercio/domains/sicomerciomppa.com.br/public_html/adm/fotos/videos/$antigo";
if (!unlink($antigoo))
{
//echo ("Erro ao deletar $antigo");
}
else
{
// echo ("Deletado $antigo com sucesso!");
}
include"conexao.php";
// Create connection
$conn = new mysqli($host, $user, $pass, $db);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// sql to delete a record
$sql = "DELETE FROM videos WHERE id='$id' and arquivo = '$antigo' ";
// echo"$sql";
if ($conn->query($sql) === TRUE) {
} else {
echo "Error deleting record: " . $conn->error;
}
$conn->close();
echo"<script type='text/javascript'>
window.alert('EXCLUIDO COM SUCESSO!')
setTimeout(function() {window.history.back()}, 1000);
</script>";
?>
Zerion Mini Shell 1.0