如何列出使用PHP的Windows共享內容?如何使用PHP在本地網絡上遍歷目錄?
$SearchFolder = "\\\\192.168.1.100\\pdfoutput\\";
if (is_dir($SearchFolder))
{
if ($Directory = opendir($SearchFolder))
{
while (($File = readdir($Directory)) !== false)
{
if(filetype($SearchFolder.$File) == "file")
{
$this->Attachments[] = new Attachment($SearchFolder.$File);
}
}
closedir($Directory);
}
}
打印(opendir($ SearchFolder));出現此錯誤:
Warning: opendir(\192.168.1.100\pdfoutput) [function.opendir]: failed to open dir: No error in C:\Users\gary\Webserver\QuickMail\maildetails.php on line 227
這不按預期方式工作。有什麼想法嗎?
您可以通過將問題映射到驅動器來解決問題嗎? – Greg 2009-08-16 17:50:56
你還使用PHP或Apache?如果你的谷歌「php unc路徑」,你會得到一些關於權限的結果可能對你有幫助,但是它們在不同的web服務器上有所不同 – Greg 2009-08-16 17:57:19
@Greg:這兩個,當然?他在Windows上的Apache服務器上使用PHP語言(我假設)。至少,這兩者不是相互排斥的。 – DisgruntledGoat 2009-08-16 18:09:52