Jump to content


Photo

Is this line of code right please?


  • Please log in to reply
5 replies to this topic

#1 Stevis2002

Stevis2002
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 25 April 2006 - 06:55 PM

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

#2 ypirc

ypirc
  • Members
  • PipPipPip
  • Advanced Member
  • 54 posts

Posted 25 April 2006 - 06:59 PM

After the last quote should be a period, not a comma.

#3 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 25 April 2006 - 06:59 PM

how about

$img = $my_data['path'];

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

If you're not part of the solution, you're part of the precipitate

#4 Stevis2002

Stevis2002
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 25 April 2006 - 07:07 PM

[!--quoteo(post=368581:date=Apr 25 2006, 07:59 PM:name=sanfly)--][div class=\'quotetop\']QUOTE(sanfly @ Apr 25 2006, 07:59 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
how about

$img = $my_data['path'];

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


Thanks for the help...No luck though.

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

#5 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 25 April 2006 - 07:37 PM

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

$img = $my_data['path'];

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

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

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

$img = $my_data['path'];

echo '<img src="' . $img . '">';

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#6 Stevis2002

Stevis2002
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 26 April 2006 - 09:57 AM

[!--quoteo(post=368593:date=Apr 25 2006, 08:37 PM:name=litebearer)--][div class=\'quotetop\']QUOTE(litebearer @ Apr 25 2006, 08:37 PM) View Post[/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

$img = $my_data['path'];

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

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

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

$img = $my_data['path'];

echo '<img src="' . $img . '">';

Lite...
[/quote]

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users