trashbin/include/cleanup.inc.php
Jan-Erik Rediger d9829fb81f initial import
2014-07-07 10:54:45 +02:00

15 lines
400 B
PHP
Executable file

<?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()."'");
?>