How do I make Image hyper link

Discussion in 'PHP' started by arunkw, Aug 9, 2012.

  1. #1
    I have a a thumbnail image which I want to hyperlink in php I am not able to do it and have spend 3 hours breaking my head on it.
    All I want is to use the value of hyperlink coming from permallink() as my hyperlink source
    Guys experts please help
    my piece of code is this
    how to hyperlink the image.jpg

     
    arunkw, Aug 9, 2012 IP
  2. RecessionProof-Business

    RecessionProof-Business Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In most email programs you can paste an image and then add a hyperlink, then copy it anywhere you want to put it.

    Success to all,
     
  3. arunkw

    arunkw Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Oh, sorry I should have mention more clearly. I am not talking about email program here.
    I am working on WordPress for my website and using tungstenation theme in which I am trying to tweak the theme.

    In one of the php page I want to hyper link the thumbnail image, but since it is a mesh-up of html code and php, I am not able to do it need some programming advice.
     
    arunkw, Aug 9, 2012 IP
  4. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #4
    
    $link = "the hyperlink here";
    echo '<img src="'.$link.'" />';
    
    PHP:
     
    Rukbat, Aug 10, 2012 IP
  5. arunkw

    arunkw Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    Thanks got the answer using tag a href before php code resolved the issue, It was so simple. Thanks a ton Rukbat and RPB
     
    arunkw, Aug 10, 2012 IP
  6. DomainerHelper

    DomainerHelper Well-Known Member

    Messages:
    445
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    100
    #6
    lol, that doesn't make a clickable link silly:)
     
    DomainerHelper, Aug 10, 2012 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #7
    You're right. That'll teach me to type a response when I'm on the phone. It's an href, of course, with the <img> tag as the text.
     
    Rukbat, Aug 10, 2012 IP
  8. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #8
    Kinda thought that was what you were asking -- you just wrap the IMG in an anchor (A)...

    Though... if you don't know enough HTML to know that's how you do it, you probably are NOT ready to be doing anything in PHP yet... Not that it seems to stop anyone -- view source on 90%+ of the stock templates on CMS and shopping cart systems for proof enough of that.
     
    deathshadow, Aug 11, 2012 IP
  9. DomainerHelper

    DomainerHelper Well-Known Member

    Messages:
    445
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    100
    #9
    @Rukbat I figured it was something like that lol, is all good.

    SO TRUE!!!
     
    DomainerHelper, Aug 11, 2012 IP
  10. steveguava88

    steveguava88 Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    img src tag is used to the image hyper Link
     
    steveguava88, Aug 20, 2012 IP
  11. Candan

    Candan Peon

    Messages:
    7
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    img src= gives you an image

    if you make a link to your server/$image_link with an Anchor tag <a href="//linkhere">Blablabla</a> you get a clickable link.
     
    Candan, Aug 20, 2012 IP