![](/img/trans.png)
[英]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.