Welcome Guest, Not a member yet? Register   Sign In
DIsplay Images from folder into website using the MVC framework
#1

I wish to display an image in a website using PHP - MVC framework. I've got the following in views:
Code:
echo("<img src=\images/test.jpg" />");
but all I am is getting a square coming up. Can someone give me a nudge in the right direction?  Do I need to have some code in the controller, and if so what is required?


Thanks
Reply
#2

PHP Code:
<img src="<?php echo base_url('images/test.jpg'); ?>" /> 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Also working:
PHP Code:
<img src="<?php echo base_url() . 'images/test.jpg'; ?>" /> 
Reply
#4

Thank you
Reply




Theme © iAndrew 2016 - Forum software by © MyBB