Does anyone know how I can list all of the directories I've got in my domain list?
I've tried the code below:
But all I’m getting is: Unable to open /hsphere/local/home/arrivalphp/
I can get it working if I add a domain to the end of the path (/hsphere/local/home/arrivalphp/domainname.co.uk), but I need to be able to list all of the domains.
Is there any way around this or another way of doing it?
Jodo said it may not be possible since PHP runs under web server privileges but suggested using Pearl, but I'm not sure how that works?
Thanks
Chris
I've tried the code below:
PHP:
// Define the full path to your folder from root
$path = "/hsphere/local/home/arrivalphp/";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index2.php" )
continue;
echo "<a href=\"$file\">$file</a><br />";
}
// Close
closedir($dir_handle);
But all I’m getting is: Unable to open /hsphere/local/home/arrivalphp/
I can get it working if I add a domain to the end of the path (/hsphere/local/home/arrivalphp/domainname.co.uk), but I need to be able to list all of the domains.
Is there any way around this or another way of doing it?
Jodo said it may not be possible since PHP runs under web server privileges but suggested using Pearl, but I'm not sure how that works?
Thanks
Chris