Welcome Guest, Not a member yet? Register   Sign In
src images
#1

[eluser]minagabriel[/eluser]
could you please tell me where can i place my images folder in CI

to make my image source
src="/images/logo.jpg"
#2

[eluser]BaRzO[/eluser]
create new folder as images next to index.php you can use like this src="'.base_url().'images/logo.jpg"
#3

[eluser]sprise[/eluser]
/images/ is always relative to the current document, so the path would only work for pages in the same level as the folder.

I put my images folder in my root and let CI generate the absolute path for me, as the poster above did. It is just a little extra code but saves me time when it comes to taking the site live.

Code:
<img src="&lt;?= base_url() . 'image.jpg'; ?&gt;" />
#4

[eluser]minagabriel[/eluser]
what i did -> i create folder and call it images @ codeigniter/images
and place jpg image logo.jpg
and then i tried to call it from the following code
<a href="&lt;?php echo base_url(); ?&gt; ">
<img src=" &lt;?php echo base_url();?&gt; /images/logo.jpg" border="0"/>
</a>
<div> &lt;?php echo anchor("welcome/about_us","about us");?&gt; &nbsp;
&lt;?php echo anchor("welcome/contact", "contact");?&gt;
&lt;?php echo base_url() . "welcome/contact" ; ?&gt;
&lt;?php
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();
?&gt;
</div>
nothing happened
#5

[eluser]sprise[/eluser]
You did all of that above code and nothing happened? You running it on a webserver (e.g. Apache) and using the extension .php, right? Just trying to cover the bases...
#6

[eluser]minagabriel[/eluser]
actually sprise iam using xampp and what u mean by covering the bases ??
and what i did is the right ?
#7

[eluser]Unknown[/eluser]
I put my images folder in my root and let CI generate the absolute path for me, as the poster above did. It is just a little extra code but saves me time when it comes to taking the site live.
#8

[eluser]Bas Vermeulen[/eluser]
Meh, I like to keep things organized. I have a folder called public, in there I have some more folders including an image folder Wink

@minagabriel: are you on linux? Cause if you are, you might want to check the permissions of your images and the image folder Smile
#9

[eluser]minagabriel[/eluser]
no iam not iam using win7
#10

[eluser]minagabriel[/eluser]
do u guys now any tutorial explaining this




Theme © iAndrew 2016 - Forum software by © MyBB