~/www/admin/webmaster/file_cmds.php
~/www/content/
I'm trying to use rmdir() & exec(), in file_cmds.php to manipulate files & folders in the content dir. It's not working. I can only manipulate files in the same dir as the script.
How should I specify the path?
Failed attempts:
~/www/content/
/home/user/www/content/
Here is an example of code i'm using:
Code: Select all
<?php
if(file_exists($dir))
{
#@ prevents from errors being outputted when rmdir() fails.
$emptydir=@rmdir("$dir");
if(!$emptydir)
{
exec("rm -r $dir");
}
}
?>