Re: [請益] 請問有以 web 方式列出目錄檔案的程式嗎?

看板PHP作者 (我是5566)時間17年前 (2008/07/07 19:26), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
※ 引述《MyNameIs5566 (我是5566)》之銘言: : 請問一下, : 有沒有這種懶人軟體, : http://autoindex.sourceforge.net/demo/ : 類似這樣的功能, : 能直接列印出 linux 主機下某個資料夾的檔案, : 並且支援中文 UTF-8 編碼的中文檔名, : 最好是 PHP4 的, : 不要動到MySQL的。 : 請問, : 有這麼好的軟體嗎? : ps:我寫不出來啦.......板眾不要叫我自己寫啦~ ^^||| 自問自答一下: <? echo "<HTML><Meta Http-Equiv=Content-Type Content=text/html; Charset=UTF-8>"; //define the path as relative $path = "./"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "Directory Listing of $path<br/><hr>"; //running the while loop while ($file = readdir($dir_handle)) { if($file!="list.php" && $file!=".list.php.swp" && $file!=".." && $file!=".") { echo "<a href=".$file.">"; echo "$file"; echo "</a><br>"; } } //closing the directory closedir($dir_handle); echo "</HTML>"; ?> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.104.148.38
文章代碼(AID): #18SVrykq (PHP)
文章代碼(AID): #18SVrykq (PHP)