Reputation: 2973
I am trying to display the image based on the path which is retrieved from mySQL. The file path is correct yet it doesn't display.
My code is
echo '<td><img src="' .$img_path .$row['image'].'" width="150" height="25" alt="'.$row['date_added'].'" /></td>';
and it outputs this.
<img width="150" height="25" alt="2014-01-01 15:52:20" src="localhost/website/content/images/profile/test.png"></img>
also it outputs </img>
instead of />
Am I missing something obvious here?
Upvotes: 0
Views: 975
Reputation: 4201
add http://
to path of image as follow:
echo '<td><img src="http://' .$img_path .$row['image'].'" width="150" height="25" alt="'.$row['date_added'].'" /></td>';
Upvotes: 1