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

  • SEARCH
  • Home
  • 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 858549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:33:26+00:00 2026-05-15T08:33:26+00:00

I have a problem with links testing locally using Apache with Windows. The final

  • 0

I have a problem with links testing locally using Apache with Windows. The final links have the following format:

file:///C:/Documents and Settings/USUARIO/My Documents/xampp/htdocs/my_website/images/january/my_image.jpg

The images do not show. However, if I directly copy the src from the img tag and paste it into the browser (Firefox), the image shows up.

I generate the links using the following code:

I define the images directory using: define(IMAGE_DIR, dirname(__FILE__).'/images/');
Then I use the following to format the path:

$imgPath = IMAGE_DIR.$month.$img;   
if($localServer)
{
   $imgPath = str_replace('/','\\', $imgPath);
   $imgPath = 'file:///'.$imgPath;
}

What I’m I doing wrong?

  • 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-05-15T08:33:27+00:00Added an answer on May 15, 2026 at 8:33 am

    You are generating image sources that use file:// URLs in a page that was loaded from a web server. File URLs instruct the browser to load a file directly from the disk without making a request to the web server. For security reasons, Firefox and other browsers don’t allow pages served by a web server to reference local files, so don’t show the images. People accessing your site remotely won’t be able to access the files either because the image source would be a reference to a path on their computer.

    To get the images to appear, you’ll need to change your image sources to refer to locations on a web server, for example images/january/my_image.jpg or /images/january/my_image.jpg.

    images/january/my_image.jpg will be interpreted by the web browser relative to the page being requested. For example, if the image appears on the page at http://localhost/page1.php, then the browser will request http://localhost/images/january/my_image.jpg. However, if the image is used on a page at http://localhost/subdir/page1.php, the browser will request http://localhost/subdir/images/january/my_image.jpg instead.

    /images/january/my_image.jpg will always be interpreted relative to the root of the website. The web browser will request http://localhost/images/january/my_image.jpg for any page on http://localhost.

    You can also use an absolute URL if you need to refer to an image on another web server, for example, http://otherhost/images/january/my_image.jpg.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have little unusual problem to solve. I need some hint or links to
I have a column that contains links. The problem is that the titles of
I have a RichTextBox which contains links posted by the users. The problem is
I have recently learned to create dynamic links via php, but my problem today
I've got an interesting box-model problem here. I have a header full of links,
i have a problem using the Catch Clipboard Events code found on this link
I have a flash file menu i am having problem while link it to
I found the following lines in a makefile tutorial, but I have some problem
My problem is quite simple: I have a 400MB file filled with 10,000,000 lines
I have used absolute links throughout my site, the problem comes when I am

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.