trashbin/include/cleanup.inc.php

16 lines
400 B
PHP
Raw Normal View History

2014-07-07 08:54:45 +00:00
<?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()."'");
?>