Stevis2002 Posted April 25, 2006 Share Posted April 25, 2006 Hi all, i have my images location paths stored in my db as "/images/hftht.jpg" etcI 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 Quote Link to comment https://forums.phpfreaks.com/topic/8393-is-this-line-of-code-right-please/ Share on other sites More sharing options...
ypirc Posted April 25, 2006 Share Posted April 25, 2006 After the last quote should be a period, not a comma. Quote Link to comment https://forums.phpfreaks.com/topic/8393-is-this-line-of-code-right-please/#findComment-30689 Share on other sites More sharing options...
sanfly Posted April 25, 2006 Share Posted April 25, 2006 how about[code]$img = $my_data['path'];echo "<img src='http://www.xxxxx.co.uk/images/$img'>";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/8393-is-this-line-of-code-right-please/#findComment-30690 Share on other sites More sharing options...
Stevis2002 Posted April 25, 2006 Author Share Posted April 25, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/8393-is-this-line-of-code-right-please/#findComment-30693 Share on other sites More sharing options...
litebearer Posted April 25, 2006 Share Posted April 25, 2006 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... Quote Link to comment https://forums.phpfreaks.com/topic/8393-is-this-line-of-code-right-please/#findComment-30701 Share on other sites More sharing options...
Stevis2002 Posted April 26, 2006 Author Share Posted April 26, 2006 [!--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 :) Quote Link to comment https://forums.phpfreaks.com/topic/8393-is-this-line-of-code-right-please/#findComment-30884 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.