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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:58:07+00:00 2026-05-30T10:58:07+00:00

I have a web site that have HTML pages stored in a private folder.

  • 0

I have a web site that have HTML pages stored in a private folder. I want a PHP script that can read the HTML file then push it to the browser.

My tought was to get the html file with the file() function in PHP. Then echo() it to the browser. That works for the html content of the page. The images and the css does not follow however.

I heard of a “render” function in IIS or ASP that render the HTML content of a web page in a private folder then send the images in a binary format. Does PHP have something similar?

Currently I read the file as follow :

$htmlFile = file(PATHTOFILE);
echo(implode('',$htmlFile));

The reason we are trying to do that is to protect the url / information of the pages contained in this folder. The user will have to connect to the web service, then the PHP script will push the html pages

  • 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-30T10:58:09+00:00Added an answer on May 30, 2026 at 10:58 am

    You can use the tag base to solve the problem of the relative path of the files, something like this:

    $html = file_get_contents($url);
    $html = str_replace('<head>', '<head><base href="FULL PATH OF DIR" />', $html);
    echo $html;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web service site that is restful enabled, so other websites/ajax script
I have a website that right now, runs by creating static html pages from
I have an existing website running on IIS6 that has only static HTML pages.
I have a web site that is a customer to customer (C2C) service. Example,
I have a web site that I administer that uses Apache 2.0 on the
I have a web site that spits out links to third party sites. Now
I have a web site that runs both classic ASP and ASP.NET Webforms. The
I have a web site that work with external Credit Card Processing (cybersource) when
I have a asp.net web site that was developed on the .Net Framework v2
I have inherited a web site project that makes use of a number of

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.