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

i have this header code to call an image
this is my view
<a href="&lt;?php echo base_url(); ?&gt; ">
<img src=" &lt;?php echo base_url();?&gt; /images/logo.jpg" border="0"/>
<div> &lt;?php echo anchor("welcome/about_us","about us");?&gt; &nbsp;
&lt;?php echo anchor("welcome/contact", "contact");?&gt;

echo form_open("welcome/search");
$data = array(
"name" => "term",
"id" => "term",
"maxlength" => "64",
"size" => 30
echo form_input($data);
echo form_submit("submit","search");
echo form_close();

the image never load to my view
my images folder is in codeigniter/images/logo.jpg "is thats where we place the folder "?
is the codeigniter the root ?
and what is the story of .htaccess how do i create it ?
i need help as soon as you guys can thnx

You're using the base_url ... which points to what ever you set the base_url to in the config.php file... which should be your site root...

I'm new to this, but I would hesitate to put anything into any folder other than application... the other folders in the system folder are part of what drives CI. I keep my images in two folders right off the site root... I've had to make a few adjustments to my src references to get it to work right, but that seems to be working. I'd say the images folder should be off the site root, or in the application folder (maybe even in the views folder.... eeeeh... maybe).


Assets should not be in application, application shouldn't be treated as a filesystem, because as far as CI is concerned it isn't. Most people put an assets folder (or folders) at the same level as index.php, it makes accessing them significantly easier.

The problem here, I'm guessing, is that there are spaces in the image src:

"&lt;?php echo base_url();?&gt;images/logo.jpg"

Theme © iAndrew 2016 - Forum software by © MyBB