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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:31:52+00:00 2026-05-23T07:31:52+00:00

Describe the mechanics in PHP relevant terms of a PHP/MYSQL page (A.php) that will

  • 0

Describe the mechanics in PHP relevant terms of a PHP/MYSQL page (A.php) that will 1) use one template to write itself (simple), 2) take input from the user to update a database (simple), 3) upon command parse another PHP page (B.php) (???) and save (B.php) page as a static HTML (B.html) (???).

UPDATE= I found a post, here at SO, helpfully suggesting (to another, GROAN, non-Uber Geek with a completely Pedestrian Question) he could capture html from a php page using output buffer. Will this work for a different php file?

  • 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-23T07:31:52+00:00Added an answer on May 23, 2026 at 7:31 am

    It saddened me to get reamed on this question. To show my Q was in good faith, I’m answering my own question with what was a simple solution. I created generate.php to run when a change was made to the content. No cache needed.

    // the switch...
    $update_live = isset($_GET['update_live']) ? TRUE : FALSE;
    // $adminPath, $livePath, $adminUrl are set in an include and contains site config data...
    $tempfile = $adminPath . 'tempindex.html'; //a temp file...
    $livefile = $livePath . 'index.html'; //the static live file...
    $this_template = $adminUrl . 'main-index.php'; //the php template file...
    $username = "php_admin";
    $password = "123xyz456";
    
    if(!($update_live)){
            $errors[] = "Did not submit from an edit page. You can only access this page by referral!";
    }else{
            if(file_exists($tempfile)){
                    unlink($tempfile);
            }
            /* =3, $html = file_get_contents($this_template, false, $context);*/
            $html = file_get_contents($this_template);
            if($html === false){
                    $errors[] = "Unable to load template. Static page update aborted!";
                    exit();
            }
            if(!file_put_contents($tempfile, $html)){
                    $errors[] = "Unable to write $tempfile. Static page update aborted!";
                    exit();
            }
    
            if(!copy($tempfile, $livefile)){
                    $errors[] = "Unable to overwrite index file. Static page update aborted!";
                    exit();
            }
            if(!unlink($tempfile)){
                    $errors[] = "Unable to delete $tempfile. Static page update aborted!";
                    exit();
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Describe please a typical lifecycle of a Hibernate object (that maps to a db
Can anyone describe the following php function: function get_setting_value($settings_array, $setting_name, $default_value = ) {
I have designed a stylesheet/javascript files bundler and minifier that uses a simple cache
I use a index.php to control the access of pages. Here is the mechanism:
I have two arrays of attributes that describe products in the database: $sizes =
There are pages scattered around the web that describe POSIX AIO facilities in varying
I have a mobile platform that I am trying to write some communications code
Being asked to describe what a virtual function is seems to be one of
Describe the output of the following SQL query: select custId, name from customer where
Can someone describe what a symbol table is within the context of C and

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.