How To Display Image?




App

-assets

-css

-protected

--zone image    <<<< image in here

--views

---customers

----index.php     <<<show in this page



I try this but Object not found!




$image = '/../zone image/1.jpg'];

echo '<img src="', $image, '">';



how to solve this problem.

Thank you.

Hi kenjisoul,

We usually store image files in a web accessible directory like this:




App

-assets

-css

-zone_image    <<<< image in here

-protected

--views

---customers

----index.php     <<<show in this page



You should note that "protected" directory and its sub-directories are NOT web accessible for a security reason, while "assets" and "css" directories are web accessible.

And you have to distinguish the "url" of a file and the "path" of it.

Probably you are trying to show an image with the relative "path" from the view file, but you have to give the "url" of the image file for the img tag.




$image = '/zone_image/1.jpg';

echo '<img src="', $image, '">';



Thank help very much.