note 58341 deleted from function.opendir by cmb
| From: | cmb@php.net | Date: | Tue, 11 Jun 2019 06:43:09 +0000 |
| Subject: | note 58341 deleted from function.opendir by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211233@lists.php.net to get a copy of this message | ||
Note Submitter: oryan at zareste dot com
----
There might be a bit of truth to that. If, by chance, the webmaster made a form saying "type a
random directory name here" and used that in the function, there'd be a problem. So
let's eliminate the 'function' part
$files=shell_exec("ls directory");
$result=explode("\n",$files);
'$result' will now be an array of the directory files. You can use variables in the
shell_exec command, but don't use anything that could be user-sent.