display image - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: display image (/showthread.php?tid=74286) |
display image - 6433faheemullah - 09-05-2019 <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. RE: display image - mboufos - 09-06-2019 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 RE: display image - JLDR - 09-06-2019 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'); ?>" /> |