images not viewed when going to other pages - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: images not viewed when going to other pages (/showthread.php?tid=54477) |
images not viewed when going to other pages - El Forum - 09-10-2012 [eluser]rochellecanale[/eluser] hey guys i have a big problem. The problem is i created an image folder and this is the folder where i put all my images. And when i load it in my view the first loading is fine. but when i attempt to go to the other pages it is not viewing anymore. i uses anchor tag to redirect my pages. i created a header and footer. and there i put an image of header, etc... and a navigation menu. When i clicked the navigation menu my header images is not viewing together with the css. images not viewed when going to other pages - El Forum - 09-10-2012 [eluser]deqer[/eluser] you need to show us your code. use a paste service website to show your code. images not viewed when going to other pages - El Forum - 09-10-2012 [eluser]rochellecanale[/eluser] my Controller ========================================================================================== <?php class HomePage extends CI_Controller{ public function __construct(){ parent::__construct(); $this->load->helper(array('form','html','url')); $this->load->library('form_validation'); } public function index(){ $data['title'] = "Welcome to eload Multi Level Marketing!!"; $this->form_validation->set_rules('username','Username','required|xss_clean'); $this->form_validation->set_rules('password','Password','required|md5'); if($this->form_validation->run() == FALSE){ $this->load->view('templates/header',$data); $this->load->view('sites/login'); $this->load->view('templates/footer'); }else{ $this->load->view('templates/header'); $this->load->view('sites/sucess'); $this->load->view('templates/footer'); } } public function addNewMember(){ $data['title'] = "Create your own Free Account Now!!!"; $this->load->view('templates/header',$data); $this->load->view('sites/addNewMember'); $this->load->view('templates/footer'); } } ?> images not viewed when going to other pages - El Forum - 09-11-2012 [eluser]rochellecanale[/eluser] my header ============================================================================= [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="en"> <head> <meta name="distribution" content="global" /> <meta name="description" content="Your page description here ..." /> <meta name="keywords" content="Your keywords, keywords, keywords, here ..." /> <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1_setup.css" /> <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1_text.css" /> <link rel="icon" type="image/x-icon" href="./img/favicon.ico" /> <title><?php echo $title; ?></title> </head> <!-- Global IE fix to avoid layout crash when single word size wider than column width --> <!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]--> <body> <!-- Main Page Container --> <div class="page-container"> <!-- For alternative headers START PASTE here --> <!-- A. HEADER --> <div class="header"> <!-- A.1 HEADER TOP --> <div class="header-top"> <!-- Sitelogo and sitename --> <a class="sitelogo" href="#" title="Go to Start page"></a> <div class="sitename"> <h1><a href="index.html" title="Go to Start page">Welcome to eload Multi Level Marketing</a></h1> <h2><i>http://emlmproj.com.ph</i></h2> </div> <!-- Navigation Level 1 --> <div class="nav1"> <ul> <li><a href="#" title="Go to Start page">Home</a></li> <li><a href="#" title="Get to know who we are">About</a></li> <li><a href="#" title="Get in touch with us">Contact</a></li> <li><a href="#" title="Get an overview of website">Sitemap</a></li> </ul> </div> </div> <!-- A.2 HEADER MIDDLE --> <div class="header-middle"> <!-- Site message --> <div class="sitemessage"> <h1> • COST FRIENDLY </h1> <h1>• SECURED </h1> <h1>• SUCCESS</h1> <h2>"Where success begins"...</h2> </div> </div> <!-- A.3 HEADER BOTTOM --> <div class="header-bottom"> <!-- Navigation Level 2 (Drop-down menus) --> <div class="nav2"> <!-- Navigation item --> <ul> <li><a href="index.html">HOME</a></li> </ul> <!-- Navigation item --> <ul> <li><a href="#">PRODUCTS<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="layout1.html">Layout-1 (1-col)</a></li> <li><a href="layout2.html">Layout-2 (2-col)</a></li> <li><a href="layout3.html">Layout-3 (2-col)</a></li> <li><a href="layout4.html">Layout-4 (3-col)</a></li> <li><a href="layout5.html">Layout-5 (3-col)</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> <!-- Navigation item --> <ul> <li><a href="#">PRODUCTS GALLERY<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="header1.html">Header-1 (T+M+B)</a></li> <li><a href="header2.html">Header-2 (T+M)</a></li> <li><a href="header3.html">Header-3 (T+B)</a></li> <li><a href="header4.html">Header-4 (M+B)</a></li> <li><a href="header5.html">Header-5 (T)</a></li> <li><a href="header6.html">Header-6 (M)</a></li> <li><a href="header7.html">Header-7 (B)</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> <ul> <li><a href="#">BRANCHES/LOCATION<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="header1.html">Header-1 (T+M+B)</a></li> <li><a href="header2.html">Header-2 (T+M)</a></li> <li><a href="header3.html">Header-3 (T+B)</a></li> <li><a href="header4.html">Header-4 (M+B)</a></li> <li><a href="header5.html">Header-5 (T)</a></li> <li><a href="header6.html">Header-6 (M)</a></li> <li><a href="header7.html">Header-7 (B)</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> </ul> <ul> <li><a href="#">ABOUT US<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="header1.html">Header-1 (T+M+B)</a></li> <li><a href="header2.html">Header-2 (T+M)</a></li> <li><a href="header3.html">Header-3 (T+B)</a></li> <li><a href="header4.html">Header-4 (M+B)</a></li> <li><a href="header5.html">Header-5 (T)</a></li> <li><a images not viewed when going to other pages - El Forum - 09-11-2012 [eluser]deqer[/eluser] Hmm, I think your issue is this: href=”./css/layout1_setup.css” That "." means {current folder} You want to remove the "." and keep the root "/" there. Like so: href="/css/layout1_setup.css" images not viewed when going to other pages - El Forum - 09-11-2012 [eluser]TWP Marketing[/eluser] Also, please use the [ code][ /code] formatting tags when you post code. It makes it much easier for us to read. As deqer pointed out, the leading period in the path is a problem ie: Code: <link rel=“icon” type=“image/x-icon” href=”./img/favicon.ico” /> Code: <link rel=“icon” type=“image/x-icon” href=”/img/favicon.ico” /> images not viewed when going to other pages - El Forum - 09-13-2012 [eluser]Abdul Malik Ikhsan[/eluser] I think, for dinamic url, pass after base_url() func Code: <link rel=“icon” type=“image/x-icon” href=”<?php echo base_url(); ?>img/favicon.ico” /> |