trashbin/include/cleanup.inc.php

16 lines
400 B
PHP

<?php
$BASE_DIR = "";
//require("include/config.inc.php");
$result = $db->query("SELECT * FROM files WHERE expire <= ".time());
if($db->num_rows($result)) {
while($row = $db->fetch_assoc($result)) {
unlink($uploaddir. $row['file']);
}
}
$db->query("DELETE FROM files WHERE expire <= '".time()."'");
$db->query("DELETE FROM pastebin WHERE expire <= '".time()."'");
?>