• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
display image

#1
<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.
Reply

#2
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
Reply

#3
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'); ?>" /> 
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.