我能列出已保存在服务器上传文件夹中的图像,但我不确定发布图像时发生了什么问题。我可以列出文件的名称,但无法显示图像。在使用php在我的网站上发布图像时遇到问题
代码:
<?php
if ($handle = opendir('/home/kevin/html/uploads')) {
echo "Directory handle: $handle\n";
echo "Entries:"."<br>";
while (false !== ($entry = readdir($handle))) {
//echo "$entry"."<br>";
echo "<img src = "$entry" alt = " ">"."<br>"
}
closedir($handle);
}
?>
缺少'.'连接运算符 – Ghost 2014-09-02 02:42:48