Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8939651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:51:58+00:00 2026-06-15T10:51:58+00:00

I am writeing a site in php with codeigniter, the imgs i have in

  • 0

I am writeing a site in php with codeigniter, the imgs i have in my imgs folder in the root directory of my site, i wrote the front page of my site and all the imgs load, the view loads, all css works fine. i made a copy the view and renamed to make the next view and when i load that view, none of the imgs load in it, it is the exact same code as the fist view and it loads fine, i dont under stand this, can u please help.
i am running ubuntu 12.04,
codeigniter 2.1.3 with mod_rewrite

Edit:

i left broken code with out the part that worked for the other 6 imgs

this is the code that didnt work with:
code from below that fixed everything but three items:

<img src="<?php echo base_url('path/to/image.jpg'); ?>">

this is the code it did not fix

<?php 
    if(!$this->session->userdata('is_logged_in')){
        echo '<BR />';
        echo '<a href='.base_url()."main/login".'><img src="imgs/log_in_0.png" /></a>';
        echo '<BR />';
        echo '<BR />';
        echo '<a href='.base_url()."main/signup".'><img src="imgs/sign_up_0.png" /></a>';
        echo '<BR />';
    } 

?>

this css to load background:

body 
{
    background-image:url('imgs/green_tex.jpg');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:52:00+00:00Added an answer on June 15, 2026 at 10:52 am

    This is most likely a relative vs absolute path problem.

    I am going to assume that you’re calling images like this:

    <img src="path/to/image.jpg">
    

    What you should do, is call them like this:

    <img src="<?php echo base_url('path/to/image.jpg'); ?>">
    

    As a reminder, you need to have the url helper loaded for base_url() to work. I would suggest adding it to your autoload.php file.

    In response to your recent edits:

    echo '<a href='.base_url()."main/login".'><img src="' . base_url('imgs/log_in_0.png') . '" /></a>';
    

    and for the CSS, you’re going to have to put the path in manually, such as:

    background: url(/imgs/log_in_0.png);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm biased towards writing fool-proof applications. For example with PHP site, I validate all
i have a PHP web site and i am writing some data to an
I wrote a small PHP script to edit the site news XML file. I
I am writing a site in PHP and I am noticing that the page
i have a wordpress site that currently shows the posts like http://mysite.com/index.php?p=1 and now
I'm trying to launch PHP site with apache on fedora and I have a
All, I am writing a little dynamic site in php, and am trying to
I had really a simple site written in PHP that I have just rewritten
Re-writing a photography portfolio site, and urls have to follow the format: [site].com/portfolio/[category]/[image] to
I'm working on a medium sized PHP site. I'm writing provider classes for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.