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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:42:39+00:00 2026-06-07T02:42:39+00:00

Currently developing a website and am wondering how to include pages into the main

  • 0

Currently developing a website and am wondering how to include pages into the main index (to only change a certain areas content and not the whole page) using the $_Get function.

Files would be something like index.php (where content pages are included), news.php (default page display on index), members.php, about.php, guides.php, downloads.php, sponsors.php etc.

I believe (if i remember correctly) linking with the $_Get method usually looks something like this index.php?pid=about

I would also like to find out how I can change the link (via htaccess?) to link as follows: http://www.mywebsite.com/about/ instead of mywebsite.com/index.php?pid=about

It has been some time since I have done any PHP and do not remember how the above things are done exactly.

Preview of what I am working on can be found at http://www.survivaloperations.net/dev/

  • 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-06-07T02:42:41+00:00Added an answer on June 7, 2026 at 2:42 am

    You would put all of your files in a pages folder, just reugular .php files.

    your index.php would look like this:

    include('pages/'. $_GET['pid']. '.php');
    

    And so your files would look like:

    pages/home.php
    pages/contact.php
    

    and you would go to:

    index.php?pid=home
    index.php?pid=contact
    

    respectively

    You would also want to have control over which $_GET values are allowed. I reccomend using a php switch:

     switch($_GET['pid']) {
          case "home": include("home.php"); break;
          case "contact": include("contact.php"); break;
          case "thing": include("thing.php"); break;
          default: include("404.php"); break;
     }
    

    The switch requires less code than a bunch of else if statements, and allows for a default “404”-type page to be displayed when an invalid pid is entered. It also secures users from accessing anything they shouldn’t… like “../db.php” or something (not sure if parent directory access is possible, but still).

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

Sidebar

Related Questions

Currently I am developing website in asp.net. I wanted to include spellchecker module into
I'm currently developing a website and the main navigation is made up of image
I am currently developing a website and i need that the pages loads dynamically
I'm currently developing a website which will have heavy load, and a certain amount
I'm currently developing a website, into which I've included a filter that attempts to
I am currently developing a website and am wanting to include the google plus
I am currently developing a sports website where one of the pages with be
I'm currently developing a website. Every feature works fine. However, I'm using a lot
We're currently developing a website (TYPO3 under Apache) for a customer that is supported
I'm currently developing a website in ASP .NET MVC and I require functionality for

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.