Jump to content

Is this line of code right please?


Stevis2002

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
Link to comment
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
Link to comment
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...
Link to comment
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 :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.