Jump to content

Search the Community

Showing results for tags 'remove folders and files'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hi all, I am trying to remove a folder if it exists and files within it if they exists. I keep getting this error. Fatal error: Cannot redeclare delete_directory() (previously declared in /home/content/31/1234321/html/ads/index.php:236) in /home/content/1234321/html/ads/index.php on line 236 $time04 = date("Y-m-d",time() - (60*60*24*7*26)); // 6.5 mouths (26 weeks)$time04 = mysql_real_escape_string($time04);$sql02_info_get = mysql_query("SELECT * FROM ads WHERE live='0' AND addate < TIMESTAMP('$time04')");$sql02_info_get_count = mysql_num_rows($sql02_info_get);if ($sql02_info_get_count > 0){while($row = mysql_fetch_array($sql02_info_get)){$remove_adid = $row["adid"];$directory = "pics/$remove_adid";//if(!is_dir($directory)){//echo "good";//exit(); //}else{//echo "bad";//exit(); //}function delete_directory($directory, $empty=false) // line 236{ if(substr($directory,-1) == DIRECTORY_SEPARATOR){ $directory = substr($directory,0,-1); } if(!is_dir($directory) || !is_readable($directory)){ return false; } else{ $handle = opendir($directory); while (false !== ($item = readdir($handle))){ if($item != '.' && $item != '..'){ $path = $directory.DIRECTORY_SEPARATOR.$item; if(is_dir($path)){ delete_directory($path); } else{ unlink($path); } } } closedir($handle); if($empty == false){ if(!rmdir($directory)){ return false; } } return true; }} delete_directory($directory);$remove_adid = mysql_real_escape_string($remove_adid);$sql02 = mysql_query("DELETE FROM ads WHERE adid='$remove_adid'"); } // end loop} any help?
×
×
  • Create New...