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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:27:36+00:00 2026-05-26T05:27:36+00:00

Currently, I have a system that actively generates the pages on my site using

  • 0

Currently, I have a system that actively generates the pages on my site using PHP, more or less like so:

index.php ——include(query.php);—–> query.php grabs content from a file that corresponds to index.php

Query.php simply assembles the page from the mentioned index.php file and from header, footer, and navigation files.

The index.php file acts as a sort of proxy or label if you will so that when users visit the site, instead of having urls like “query.php?page=index” they have real pages.

The issue of course is that this is a bit convoluted. For each page of the site, I need 2 files: the “wrapper” file (such as index.php) and a content file to which it corresponds. I’d like to only be using a single file. The issue is that the single file should only contain the content of the page – not structure, header, footer etc.

So, what I’d like to be able to do is to be able to have index.php contain ONLYand a paragraph for example. When it is accessed, somehow PHP kicks in and applies a template and the header and footer.

Is PHP too high level a language to be able to do this? I know it is often done with Tomcat and java servlets, but I thought it would be cool to do with PHP.

EDIT: Important point, I don’t want to use GET variables.

  • 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-26T05:27:36+00:00Added an answer on May 26, 2026 at 5:27 am

    It’s a bit hard to tell what you’re trying to do, but have you looked into using a framework such as Kohana or Synfony? This will do pretty much exactly what you’re asking.

    If you’re looking for a good template system, I suggest PHPTAL.

    Failing that, it doesn’t sound like you need to do anything that special. On the index.php page, why not just include header.php, the content, and footer.php? Short of using auto_append_file and auto_prepend_file, you can’t add content to the page that is not explicitly in the code.

    It sounds like what you want to do is route all requests through a single point (like frameworks do). Let’s call it main.php.

    On main.php you would have:

    include header.php
    include $_SERVER['PATH_INFO'] . ".php" //Requested file from URL.  TODO handle this better
    include footer.php
    

    Then you would route all requests (using your server configuration) to “/main.php/pagename.” Then pagename would only need its respective content.

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

Sidebar

Related Questions

I have a system that generates particles from sources and updates their positions. Currently,
We have a system that is migrating from an older VARCHAR using LIKE setup
I currently have built a system that checks user IP, browser, and a random-string
We currently have an inventory management system that was built in-house. It works great,
I currently have an archaic system of client records that I am trying to
I have an existing system built in Java we currently expand that by adding
I currently have a class file with the following enumeration: using System; namespace Helper
We currently have a system that displays a page tabular data on the screen
I currently have a legacy system that uses SPs exclusively for access to the
We have a CMS system that we're currently taking the admin back end 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.