I am new to PHP and Codeigniter and trying to create a blog where visitors can read submitted posts.Now the posts may consist of both text and images.The images are stored in a folder named "images" which is directly under my application's root directory(which itself is under "www" of WAMP i.e. www/application_dir/images).But the problem is that if I give a absolute path(like http://localhost/application_dir/images/img1.jpeg) to a image file in "src" attribute the image is not displayed in browser.Someone suggested in one of my previously posted questions that this is because my "images" folder is not publicly accessible.He also mentioned about public_html(which I have no idea about).So,how do I configre my WAMP to allow display of images in browser.I am using PHP,Codeigniter and MVC.Also is it a good strategy to make the "images folder" or "www" folder publicly accessible?Will it cause any security issues.(Currently I am displaying the images by reading the image files from the containing folder using a controller,converting them to base64 encoding and then putting the result as value for the src attribute)
Asked
Active
Viewed 283 times
1 Answers
0
(image file in "href" attribute the image) image has src attribute not href it's for links..

Taj Khan
- 579
- 2
- 7
- 22
-
Thank you.Actually I intended to write "src" not "href". in my question.Anyways the problem was that I forgot to add the base_url() [ form codeigniter] to the relative path.I have corrected it now and everything is fine.Thanks for the reply again – stackoverflownewbie Jun 06 '16 at 20:38