PHP代码点火器->;不显示根文件夹中的图像
我已经搜索了这个问题的答案,但似乎我的图像不会显示在管理视图上 我的图像位于localhost的根文件夹中 它在web控制台中向我显示了这个错误PHP代码点火器->;不显示根文件夹中的图像,php,image,codeigniter,localhost,wamp,Php,Image,Codeigniter,Localhost,Wamp,我已经搜索了这个问题的答案,但似乎我的图像不会显示在管理视图上 我的图像位于localhost的根文件夹中 它在web控制台中向我显示了这个错误 GET http://localhost/tarea8/fotos/8.png 404 (Not Found) GET http://localhost/tarea8/fotos/9.png 404 (Not Found) 这是我获取图像的代码 <?php $imagenes = cargar_imagenes(); //$
GET http://localhost/tarea8/fotos/8.png 404 (Not Found)
GET http://localhost/tarea8/fotos/9.png 404 (Not Found)
这是我获取图像的代码
<?php
$imagenes = cargar_imagenes();
//$route = base_url('fotos');
foreach($imagenes as $imagen){
echo "<tr>"?>
<td><img src="<?php echo base_url('/fotos')?>/<?php echo $imagen->id?>.png" height='50' class="img-thumbnail"></td>
<?php
echo
"<td>{$imagen->id}</td>
<td>{$imagen->nombre}</td>
<td>{$imagen->comentario}</td>
<tr>";
}
?>
/.png“height='50'class=“img缩略图”>
cargar_imagenes是我调用数据库并调用通过id分配的图像的方法,一切都很好,但由于某些原因图像不会显示
希望有人能提供帮助。如果是,请在数据库中保存图像扩展名,然后在图像代码后删除.png试试这个
<td><img src="<?php echo base_url('fotos/'.$imagen->id); ?>" height='50' class="img-thumbnail"></td>
id);?>“height='50'class=“img缩略图”>
在base\u url('fotos')中尝试使用正斜杠。
确保在config.phptry中设置了baseurl以添加分号'echo”“;?>`在你的echo
语句的末尾。谢谢,我好像在.htaccess中更改了一些配置访问权限,然后它接受了你编写的路由,并显示了图像。