Results 1 to 3 of 3

Thread: Make an Image into a Link

  1. #1
    Join Date
    May 2008

    Make an Image into a Link

    I'd like to turn an image saved on my server into a button using PhP. I know it's easier to use HTML, but it's part of a Drupal module someone else wrote that I'm tinkering with and I'm no expert so I have to work with what I have. Any advice is certainly appreciated.

    Here is the relevant line of code:

    $content .= '<div class="biblio_export"> Export:['.l("Tagged","$base/export/tagged"). ']</div>';
    I would like to replace the word "Tagged" with an image at location:


    Thanks very much


  2. #2
    PHP Code:
    $content .= '<div class="biblio_export"> Export:['.l("<img src=\"/files/images/myimage.jpg" />","$base/export/tagged"). ']</div>'; 

  3. #3
    Join Date
    May 2008
    Thanks, I tried something similar. When I try that code, it outputs the HTML verbatim rather than treating it as HTML and showing the image:

    Export:[<img src="/files/images/myImage.jpg" />]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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