File lsiting exec(ls... using variables.
| From: | Vernon | Date: | Fri, 13 Jun 2003 19:40:37 +0000 |
| Subject: | File lsiting exec(ls... using variables. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151415@lists.php.net to get a copy of this message | ||
I'm trying to add a variable to the end of a directory listing.
This will give me the root directory and show me all the files
exec('ls /home/httpd/vhosts/sitename.com/httpdocs/resumes/',
$filelist);
I figured I could do this but it shows me all the files in the root of the
site not of the folder I want. So what it seems is that it is ignoring the
$path variable all together.
$folder = $HTTP_GET_VARS['id'];
$path = "/home/httpd/vhosts/sitename.com/httpdocs/resumes/$folder/";
exec('ls $path', $filelist);
I've even tried to add echo but then nothing at all is listed:
exec('ls <? echo $path; ?>', $filelist);
Any ideas?