circumventing SAFE MODE Restriction

From: Date: Thu, 03 Apr 2003 17:09:50 +0000
Subject: circumventing SAFE MODE Restriction
Groups: php.general 
Request: Send a blank email to php-general+get-142175@lists.php.net to get a copy of this message
Hi All, I want to get a list of files in my own sub-directory from where my .php file is. If I use dir(".") then I can list the file in the current directory BUT If I use dir("./subdirectory") or dir("subdirectory") I get the following error: Warning: SAFE MODE Restriction in effect. The script whose uid is 614 is not allowed to access /home/currentdirectory owned by uid 0 in /home/currentdirectory/download.php on line 12 Handle: Path: Fatal error: Call to a member function on a non-object in /home/currentdirectory/download.php on line 15 The code looks like this. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php // get a list of all the .zip files // generate the page if the .gif or .jpg file of the same name exists use that as an icon otherwise use a picture! $d = dir(".\downloads"); echo "Handle: ".$d->handle."<br>\n"; echo "Path: ".$d->path."<br>\n"; while (false !== ($entry = $d->read())) { echo $entry."<br>\n"; } $d->close(); ?> </body> </html> Any ideas about how to get round this other than making a .php file to call in the subdirectory? TIA Henry

« previous php.general (#142175) next »