note 79759 added to function.opendir
| From: | PeterHkansson at osu1 dot php dot net | Date: | Tue, 11 Dec 2007 17:01:08 +0000 |
| Subject: | note 79759 added to function.opendir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-133370@lists.php.net to get a copy of this message | ||
Would you like to view your directories in your browser this script might come in handy.
<?php
$sub = ($_GET['dir']);
$path = 'enter/your/directory/here/';
$path = $path . "$sub";
$dh = opendir($path);
$i=1;
while (($file = readdir($dh)) !== false) {
if($file != "." && $file != "..") {
if (substr($file, -4, -3) =="."){
echo "$i. $file <br />";
}else{
echo "$i. <a href='?dir=$sub/$file'>$file</a><br />";
}
$i++;
}
}
closedir($dh);
?>
----
Server IP: 129.16.214.50
Probable Submitter: 85.230.169.137
----
Manual Page -- http://www.php.net/manual/en/function.opendir.php
Edit -- https://master.php.net/note/edit/79759
Del: integrated -- https://master.php.net/note/delete/79759/integrated
Del: useless -- https://master.php.net/note/delete/79759/useless
Del: bad code -- https://master.php.net/note/delete/79759/bad+code
Del: spam -- https://master.php.net/note/delete/79759/spam
Del: non-english -- https://master.php.net/note/delete/79759/non-english
Del: in docs -- https://master.php.net/note/delete/79759/in+docs
Del: other reasons-- https://master.php.net/note/delete/79759
Reject -- https://master.php.net/note/reject/79759
Search -- https://master.php.net/manage/user-notes.php