【发布时间】:2016-03-14 12:18:48
【问题描述】:
<?php
// directory path can be either absolute or relative
$dirPath = "C:/xampp/htdocs/statistics/pdf/";
// open the specified directory and check if it's opened successfully
if ($handle = opendir($dirPath)) {
// keep reading the directory entries 'til the end
$i=0;
while (false !== ($file = readdir($handle))) {
$i++;
// just skip the reference to current and parent directory
if (eregi("\.pdf",$file)){
if (is_dir("$dirPath/$file")) {
// found a directory, do something with it?
echo "<a href='$dirPath/$file' ><font color='black' link='black' vlink='black' > $file </font></a><br>";
} else {
// found an ordinary file
echo "<a href='$dirPath/$file' ><font color='black' link='black' vlink='black' >$i . $file </font></a><br>";
}
}
}
// ALWAYS remember to close what you opened
closedir($handle);
}
?>
<iframe src="xxx" width="100%" height="800"style="border: none;"></iframe>
我想将我的目录中的每个不同文件打开到 iframe div 中,以隐藏以前的文件并显示按下的链接。这些文件我从我的路径打开它,我想要一个包含这些文件的列表并在 iframe 中打开它。
【问题讨论】:
-
那么实际的问题是什么?欢迎来到SO,请访问help center查看如何提问
-
我有打开 div 的代码(到链接列表),我的列表有 100 个文件,我想在不同的 iframe 中打开它(我有 iframe 的代码)但我不知道如何从 php 中将其打开到一个 div 并替换另一个
标签: javascript php html css iframe