Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-31-2013, 08:21 PM   PM User | #1
gwolff2005
New to the CF scene

 
Join Date: Nov 2012
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
gwolff2005 is an unknown quantity at this point
php link from a echo image source. Please help!

Hi guys,
I need your help.
I created a snapshot of a website, but upto now it is just an image. How do I get that it becomes a link?? I am getting devasted. Please help.
Thanks very much in advance.

PHP Code:
<?php
    $url 
"http://www.ggg.de";
    echo 
'<img src="http://open.thumbshots.org/image.aspx?url='.$url.'" width = "150" height = "150" />';
    
?>

Last edited by gwolff2005; 01-31-2013 at 08:25 PM..
gwolff2005 is offline   Reply With Quote
Old 01-31-2013, 08:24 PM   PM User | #2
TFlan
New Coder

 
Join Date: Dec 2012
Location: USA
Posts: 82
Thanks: 3
Thanked 17 Times in 17 Posts
TFlan is an unknown quantity at this point
Wrap it in anchor tags.

PHP Code:
echo '<a href="'.$url.'"><img ... /></a>'
TFlan is offline   Reply With Quote
Users who have thanked TFlan for this post:
gwolff2005 (01-31-2013)
Old 01-31-2013, 08:25 PM   PM User | #3
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,447
Thanks: 0
Thanked 496 Times in 488 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
This is actually an HTML question rather than a PHP one since tat the HTML is being echoed from PHP is not relevant.

To convert an image into an image link in HTML you simply wrap the <img> tag inside <a></a> with the href attribute of the <a> tag identifying where the image links to.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 01-31-2013, 08:31 PM   PM User | #4
gwolff2005
New to the CF scene

 
Join Date: Nov 2012
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
gwolff2005 is an unknown quantity at this point
Hi Tflan. It worked. thanks so much!
gwolff2005 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:29 PM.


Advertisement
Log in to turn off these ads.