How 2 set auto delet file in directory in x minut

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • something else
    replied
    if you are deleting files that are not in the same directory as the script on some servers you will need to use chdir() eg:
    PHP Code:
    $old getcwd();
    chdir("images");
    unlink("something.else");
    chdir($old); 
    if i can show you an approved code i edit it,
    you dont need loads of posts from me :P
    Last edited by something else; 25.03.12, 00:32.

    Leave a comment:


  • arnage
    replied
    God no, it isn't. And i haven't at least enjoy it. I was serious.

    Leave a comment:


  • just_m3.
    replied
    Originally posted by arnage View Post
    In the script.
    head shot ! your favorit kind' of user :D enjoy !

    Leave a comment:


  • arnage
    replied
    Originally posted by PranaY4U View Post
    where i put dis?
    Originally posted by PranaY4U View Post
    i want delet my mp3 files in subderectory how to set dis script?
    In the script.

    Leave a comment:


  • PranaY4U
    replied
    Originally posted by amylee View Post
    you asked how to do it and that's how its done

    you havn't said what type of script you are using, what files you want removing
    how do you expect anyone to help without any information

    i have shown you a way to do it now try figuring it out
    i want delet my mp3 files in subderectory how to set dis script?

    Leave a comment:


  • amylee
    replied
    you asked how to do it and that's how its done

    you havn't said what type of script you are using, what files you want removing
    how do you expect anyone to help without any information

    i have shown you a way to do it now try figuring it out

    Leave a comment:


  • PranaY4U
    replied
    Originally posted by amylee View Post
    PHP Code:
       $path dirname(__FILE__).'/files';
      if (
    $handle opendir($path)) {

        while (
    false !== ($file readdir($handle))) {
            if ((
    time()-filectime($path.'/'.$file)) < 86400) {  // auto-deletion every 24 hours
              
    if (strripos($file'.txt') !== false) { //deletes particular file extension
                
    unlink($path.'/'.$file);
              }
            }
        }
      } 
    try that
    where i put dis?

    Leave a comment:


  • amylee
    replied
    PHP Code:
       $path dirname(__FILE__).'/files';
      if (
    $handle opendir($path)) {

        while (
    false !== ($file readdir($handle))) {
            if ((
    time()-filectime($path.'/'.$file)) < 86400) {  // auto-deletion every 24 hours
              
    if (strripos($file'.txt') !== false) { //deletes particular file extension
                
    unlink($path.'/'.$file);
              }
            }
        }
      } 
    try that

    Leave a comment:


  • How 2 set auto delet file in directory in x minut

    Help me n tell me.
Working...
X