Activity Stream
48,167 MEMBERS
61145 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member
    Website's:
    maxneeds.info

    Post PHP 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 !");
    }
    
    ?>
    So i am wondering where is the fault ?
    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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    clean 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


  4.     
    #3
    Member
    Website's:
    maxneeds.info
    thanks !

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Which is the file host that never delete file?
    By pacolim in forum File Host Discussion
    Replies: 26
    Last Post: 14th Nov 2011, 11:55 AM
  2. how to delete error_log file in ftp?
    By wman in forum Technical Help Desk Support
    Replies: 2
    Last Post: 19th Oct 2010, 09:48 AM
  3. Can't delete file in desktop
    By chipve in forum Technical Help Desk Support
    Replies: 5
    Last Post: 19th Oct 2010, 09:05 AM
  4. why these file hosts always delete our files
    By techdaemon in forum File Host Discussion
    Replies: 5
    Last Post: 14th Oct 2010, 05:54 AM
  5. mass file delete command
    By vgnheart in forum Server Management
    Replies: 14
    Last Post: 25th Sep 2009, 04:57 PM

Tags for this Thread

BE SOCIAL