Jump to content

Archived

This topic is now archived and is closed to further replies.

Stevis2002

Is this line of code right please?

Recommended Posts

Hi all, i have my images location paths stored in my db as "/images/hftht.jpg" etc

I am trying to pull them from the db and display them on the page, but when i do, i don't get the images displayed.

Is this code ok?


echo "<img src='http://www.xxxxx.co.uk/images/'>", $my_data['path'];


Thanks

Share this post


Link to post
Share on other sites
how about

[code]$img = $my_data['path'];

echo "<img src='http://www.xxxxx.co.uk/images/$img'>";[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=368581:date=Apr 25 2006, 07:59 PM:name=sanfly)--][div class=\'quotetop\']QUOTE(sanfly @ Apr 25 2006, 07:59 PM) [snapback]368581[/snapback][/div][div class=\'quotemain\'][!--quotec--]
how about

[code]$img = $my_data['path'];

echo "<img src='http://www.xxxxx.co.uk/images/$img'>";[/code]
[/quote]


Thanks for the help...No luck though.

Still displaying as a box where the image should be followed by ../images/picture.jpg

Share this post


Link to post
Share on other sites
Just an old coot's observation, and we know old guys can be wrong.

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]i have my images location paths stored in my db as "/images/hftht.jpg" etc[/quote]

that being the case. would not this

[code]
$img = $my_data['path'];

echo "<img src='http://www.xxxxx.co.uk/images/$img'>";
[/code]

result in this
[code]
<img src="http://www.xxx.co.uk/images//images/hftht.jpg">
[/code]

presuming the image folder is just below the script folder, why not simply

[code]
$img = $my_data['path'];

echo '<img src="' . $img . '">';
[/code]

Lite...

Share this post


Link to post
Share on other sites
[!--quoteo(post=368593:date=Apr 25 2006, 08:37 PM:name=litebearer)--][div class=\'quotetop\']QUOTE(litebearer @ Apr 25 2006, 08:37 PM) [snapback]368593[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Just an old coot's observation, and we know old guys can be wrong.
that being the case. would not this

[code]
$img = $my_data['path'];

echo "<img src='http://www.xxxxx.co.uk/images/$img'>";
[/code]

result in this
[code]
<img src="http://www.xxx.co.uk/images//images/hftht.jpg">
[/code]

presuming the image folder is just below the script folder, why not simply

[code]
$img = $my_data['path'];

echo '<img src="' . $img . '">';
[/code]

Lite...
[/quote]

Thanks for that...That did the trick :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.