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 4039160
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:34:11+00:00 2026-05-20T12:34:11+00:00

I need some help with some advanced file include code.. I googled around, but

  • 0

I need some help with some advanced file include code.. I googled around, but I’m not sure how to describe it in a short way for searching.

Basically here is the file structure:

/public_html/include_handle.php  

/protected_site/index.html
               /images/image.jpg  

If I include index.html using a regular include statement, image.jpg obviously won’t show in the browser because it’s not in a public/relative directory. Short of some heavy preg_match/replace parsing, how can I get the image to show on the include_handle.php page when including index.html? I would also like to be able to follow links to other pages from the index.html page. I know I can use iframes and put the static pages in a public directory, but I don’t want that for various reasons. Any help would be greatly appreciated, Thanks!

  • 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-20T12:34:12+00:00Added an answer on May 20, 2026 at 12:34 pm

    You can use the base HTML tag for your page to work as if it was in a different directory (or host). Relative links will be resolved using this value as the current document.

    I guess protected_site is not accessible from the web. You will need a PHP script to read the files from the protected directory and send them to the user. It will look something like:

    getimage.php?image=image.jpg
    

    If you don’t want to change the content of index.html and still link to images as something.jpg instead of the above, you can use mod_rewrite on the server side:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*?\.(jpg|gif|png))$ getimage.php?image=$1 [L]
    

    This way apache will call your PHP for any image files which do not exist in the public directory.

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

Sidebar

Related Questions

I've gone through most of the example code and I still need some help.
i really need some help on this. I searched the internet but couldn't find
I need some help from the shell-script gurus out there. I have a .txt
I need some help regarding algorithm for randomness. So Problem is. There are 50
I need some help calculating Pi. I am trying to write a python program
I need some help with jQuery script again :-) Just trying to play with
I need some help ... I'm a bit (read total) n00b when it comes
Hi I need some help with the following scenario in php. I have a
I am getting a little confused and need some help please. Take these two
I am new to all the anonymous features and need some help. I have

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.