【发布时间】:2015-03-09 00:27:40
【问题描述】:
感谢大家一直给予我的帮助。我现在的下拉框似乎在改变,但它是空白的。我正在使用的当前编码编辑如下:
<input type="hidden" name="Action" value="EDIT" /><input type="hidden" name="Selection" id="Selection" value="-1"><div>Below is the list of your saved codes. To edit your codes, select it from the list.</div>
<select>
<?php
$directory = realpath(dirname(FILE)) . '/../users/' . $_SESSION['username'];
$files = scandir( $directory ) ;
foreach( $files as $file )
{
if ( ! is_dir( $file ) )
{
echo "<option>" . $file . "</option>";
}
}
?>
</select>
当我检查页面上的空下拉元素时,我得到了这个:
警告:scandir(/home/revo/public_html/evo/../users/Addiction) [function.scandir]: 无法打开目录:/home/revo/public_html/evo/codesaveindex 中没有这样的文件或目录.php 在第 117 行
警告:scandir() [function.scandir]: (errno 2): 第 117 行 /home/revo/public_html/evo/codesaveindex.php 中没有这样的文件或目录
警告:在第 119 行的 /home/revo/public_html/evo/codesaveindex.php 中为 foreach() 提供了无效参数
【问题讨论】:
标签: php