pavelazad — 2012-08-17T03:34:07-04:00 — #1
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.
davyd — 2012-08-17T06:27:52-04:00 — #2
You need to echo the variable:
<?php echo $variable; ?>
Hope this helps.
kduv — 2012-08-17T20:05:07-04:00 — #3
Or, as shorthand, you can do <?= $variable; ?>
cpradio — 2012-08-17T20:14:14-04:00 — #4