src images - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: src images (/showthread.php?tid=33773) Pages:
1
2
|
src images - El Forum - 09-07-2010 [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" src images - El Forum - 09-09-2010 [eluser]BaRzO[/eluser] create new folder as images next to index.php you can use like this src="'.base_url().'images/logo.jpg" src images - El Forum - 09-10-2010 [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="<?= base_url() . 'image.jpg'; ?>" /> src images - El Forum - 09-15-2010 [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="<?php echo base_url(); ?> "> <img src=" <?php echo base_url();?> /images/logo.jpg" border="0"/> </a> <div> <?php echo anchor("welcome/about_us","about us");?> <?php echo anchor("welcome/contact", "contact");?> <?php echo base_url() . "welcome/contact" ; ?> <?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(); ?> </div> nothing happened src images - El Forum - 09-15-2010 [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... src images - El Forum - 09-15-2010 [eluser]minagabriel[/eluser] actually sprise iam using xampp and what u mean by covering the bases ?? and what i did is the right ? src images - El Forum - 09-16-2010 [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. src images - El Forum - 09-16-2010 [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 @minagabriel: are you on linux? Cause if you are, you might want to check the permissions of your images and the image folder src images - El Forum - 09-16-2010 [eluser]minagabriel[/eluser] no iam not iam using win7 src images - El Forum - 09-16-2010 [eluser]minagabriel[/eluser] do u guys now any tutorial explaining this |