Jump to content

[SOLVED] remove file/mysql row in a week of its upload


dezkit

Recommended Posts

Uhh, this should get you started:

 

<?php
foreach (glob('yourdirectory/*') as $filename) {
    if (filemtime($filename) < (time() - 86400)) {
        unlink($filename);
        $sql = "DELETE FROM uploads WHERE filename='$filename'";
        mysql_query($sql) or die(mysql_error());
    }
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.