Jump to content
php.lv forumi

PHP Nedzēš folderi ar contentiem


Cibiņš

Recommended Posts

Nedalec kapēc nedzēš folderi. Lapas sākumā ir error_report debugeris tik visu laiku izsviež baltu lapu un nekādas kļūdas neuzrāda.

 

Funkcijā tiek padots

 

$content_path='../media/site-images/';
$token=$_GET['tkn'];

if($op == 'delete'){
delete_content($content_path.$token);
}

 

Pati funkcija

 

function delete_content($dirname) {
if (is_dir($dirname))
   	$dir_handle = opendir($dirname);
if (!$dir_handle)
   	return false;
while($file = readdir($dir_handle)) {
   	if ($file != "." && $file != "..") {
       	if (!is_dir($dirname."/".$file))
           	unlink($dirname."/".$file);
       	else
           	delete_directory($dirname.'/'.$file);     	 
   	}
}
closedir($dir_handle);
rmdir($dirname);
return true;
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...