SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

    HTML Code:
    <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.

  2. #2
    SitePoint Member
    Join Date
    Aug 2012
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

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

  3. #3
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    211
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Or, as shorthand, you can do <?= $variable; ?>

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,121
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •