Simple problem need help pls

hii,

I have the below code where i want to use a php variable (getting as user post) inside of a image url. if i direct use folder name everything is fine but if i use php variable image doesn’t load. how can i fix it. please help me.


<a href='./admin/images/<?php $fid ?>/h66.jpg' class='cloud-zoom-gallery' title='Thumbnail 2'
                rel="useZoom: 'zoom1', smallImage: './admin/images/<?php $fid ?>/h6.jpg'">
        <img src="./admin/images/<?php $fid ?>/thmbh6.jpg" alt = "Thumbnail 2"/></a>

here $fid is a folder name and i get the $fid as user input.

Hi,

You need to echo the variable:
<?php echo $variable; ?>
Hope this helps.

Or, as shorthand, you can do <?= $variable; ?>

You posted this earlier… http://www.sitepoint.com/forums/showthread.php?873966-php-variable-in-image-link-need-help