Welcome Guest, Not a member yet? Register   Sign In
display image

<img src="<?php echo base_url() . 'images/banner.jpg'; ?>" />
i am using the above code to display an image from folder but its not working.

base_url() may be wrong, for example if you have base url= test.com this url will look on root folder of the hosting.
Usually on root folder there is a sub folder assets/images so you should add assets/images/banner.jpg.
If you have images folder on root folder then should be something wrong on .htaccess

Another thing you may consider (not for solving path problems), but:

PHP Code:
<img src="<?php echo base_url() . 'images/banner.jpg'; ?>" /> 

can be also:

PHP Code:
<img src="<?php echo base_url('images/banner.jpg'); ?>" /> 

Theme © iAndrew 2016 - Forum software by © MyBB