html - displaying an image from a php variable source -


i'm trying display image on website using html.

my problem name of image saved in php variable, i've been trying following:

<img src = <?php echo $filename;?> > 

where &filename name of file. if echo variable, correct file path operation, image not displayed. instead, on website there's little icon, has nothing image. if change this:

<img src = <?php $filename;?> > 

nothing @ displayed.

i'd grateful help.

you missing quotes:

try this:

<img src="<?php echo $filename;?>"> 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -