Results 1 to 3 of 3
-
21st Mar 2010, 07:05 PM #1OPMemberWebsite's:
maxneeds.infoPHP delete file older than ..
Each time the page loads,the file is deleted no matter the time...
Code:<?php $file = 'people.html'; if ((time() - filemtime($file)) > ($days *300)) { unlink("$file"); } if (file_exists($file)) { echo " "; } else { $file = fopen($file, 'w') or die("Server Overloaded !"); } ?>
Porsche_maniak Reviewed by Porsche_maniak on . PHP delete file older than .. Each time the page loads,the file is deleted no matter the time... <?php $file = 'people.html'; if ((time() - filemtime($file)) > ($days *300)) { unlink("$file"); } if (file_exists($file)) { echo " "; Rating: 5
-
21st Mar 2010, 07:16 PM #2MemberWebsite's:
litewarez.net litewarez.com triniwarez.comclean up your code a little!
PHP Code:
function cleanFile($file)
{
if(file_exists($file))
{
$time = filemtime($file);
$day = (60*60*24);
if($time < (time() - (300*$day)))
{
return unlink($file);
}else
{
return file_get_contents($file); //OR UPDATE
}
}
return false;
}
Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
21st Mar 2010, 08:00 PM #3OPMemberWebsite's:
maxneeds.infothanks !
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Which is the file host that never delete file?
By pacolim in forum File Host DiscussionReplies: 26Last Post: 14th Nov 2011, 11:55 AM -
how to delete error_log file in ftp?
By wman in forum Technical Help Desk SupportReplies: 2Last Post: 19th Oct 2010, 09:48 AM -
Can't delete file in desktop
By chipve in forum Technical Help Desk SupportReplies: 5Last Post: 19th Oct 2010, 09:05 AM -
why these file hosts always delete our files
By techdaemon in forum File Host DiscussionReplies: 5Last Post: 14th Oct 2010, 05:54 AM -
mass file delete command
By vgnheart in forum Server ManagementReplies: 14Last Post: 25th Sep 2009, 04:57 PM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...