Skip to content Skip to sidebar Skip to footer

How To Displaying An Image With Path Stored In Database?

I have stored images path in database and images in project folder. Now i am trying to view all IMAGES with their PRODUCTS in my HTML template. I have written the following code an

Solution 1:

Add your local image path before source

example

echo "<img src='http://localhost/cms/1/". $image_query_fetch['images'] .'" alt=\"\" />";

*Use PHP *

<?phpecho"http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>

Solution 2:

You can use the HTML base tag to set a base URL that relative URLs will be resolved from. See -> http://www.w3schools.com/tags/tag_base.asp

Post a Comment for "How To Displaying An Image With Path Stored In Database?"