/    Sign up×
Community /Pin to ProfileBookmark

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:

[code]
$content .= ‘<div class=”biblio_export”> Export:[‘.l(“[B]Tagged[/B]”,”$base/export/tagged”). ‘]</div>’;

[/code]

I would like to replace the word “Tagged” with an image at location:

/files/images/myimage.jpg

Thanks very much

Adam

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@CoyotelabApr 29.2009 — [code=php]$content .= '<div class="biblio_export"> Export:['.l("<img src="/files/images/myimage.jpg" />","$base/export/tagged"). ']</div>';[/code]
Copy linkTweet thisAlerts:
@acrymbleauthorApr 29.2009 — 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" />]
×

Success!

Help @acrymble spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...