根据php中的数据库值显示图像

时间:2018-01-08 06:08:04

标签: php html5

我正在尝试展示图片。我有一个名为5.png的图像。我的数据库值 $ bnr_value 也正确返回5。但图像没有显示。我该如何解决?

<img src="new_img/header/career/"<?php echo $bnr_value.'png'; ?> alt="" class="image" style="max-width: 100%; "> 

2 个答案:

答案 0 :(得分:0)

//试试这个..

 <img src="new_img/header/career/<?php echo $bnr_value.'.png'; ?>" alt="" class="image" style="max-width: 100%; ">

=> "new_img/header/career/" is a not a full path .. 

Example :- "new_img/header/career/<?php echo $bnr_value.'.png'; ?>" //  set like this .

答案 1 :(得分:0)

试试这个:

 <img src="new_img/header/career/<?php echo $bnr_value.'.png'; ?>" alt="" class="image" style="max-width: 100%; ">