[英]Is there a way to check the php version number just using files on the hard drive?
[英]Failed to Locate files from my Hard Drive using php
我想使用 PHP 查看我的硬盤驅動器中的文件列表。Php 腳本在 Web 服務器上可用。
$handle = opendir('G:\Backup');
while(false !== ($entry = readdir($handle))){
if($entry != "." && $entry != ".."){
echo $entry.'<br>';
}
}
closedir($handle);
我想在 ID 內的 My G: Drive
and Backup
文件夾中顯示文件列表。
它一直在加載,然后顯示504 Gateway Time-out
有什么幫助嗎。 請幫幫我。 我有這些代碼的這個文件位於這個 URL 上。 https://musicuploads.com.au/musicuploads/test.php
我從https://www.php.net/manual/en/wrappers.file.php得到了這個G:\Backup
Idea
請幫忙
我真的不認為 php 是可能的,你可以在 web 服務器上找到文件,但在你的電腦上找不到。 我會推薦一些簡單的東西,可能是 c#,你可以用應用程序完成這部分,然后將數據加載到某種數據庫中並在網站上顯示。
您可以使用我嘗試過的scandir
,它可以在本地主機上訪問我的其他分區。 讓我們知道您的狀態。
<?php
$dir="G:\Backup";
$files=scandir($dir);
foreach ($files as $file ) {
if($file!="."&&$file!=".."){
echo "$file</br>";
}
}
?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.