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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:54:13+00:00 2026-06-01T18:54:13+00:00

I’m new to php coding, web development, and search optimization – so newbie overall.

  • 0

I’m new to php coding, web development, and search optimization – so newbie overall. In the process of learning php and web development I’ve been trying out different website architectures and layouts. One I’m working on uses an approach like the following:

I have one index.php page which always loads a header.php, sidebar.php, and footer.php. The index.php also contains a switch so that depending on the page variable the index.php is passed it loads different core content. So for example a examplesite.com/index.php?page=photos and examplesite.com/index.php?page=stories would both have the same header, footer, and side bar but one would have photos and one would have stories as the main content.

<?php $page = $_GET['page'];?>

<?php include("header.php"); ?>
<?php include("nav.php"); ?>
<?php 
      switch ($page)
      {
      case 'play':
        include("photos.php");
        break;
      case 'cards':
        include("stories.php");
        break;
      default:
        include("frontpage.php");
      } 
      ?>
<?php include("footer.php"); ?>

My navigation is made up of href=”index.php?page=…” links so choosing a menu button on the index page essentially calls itself passing it the new core to load.

I have no idea if this is a totally unorthodox approach but it all started because I was initially going to create a wordpress theme but then halfway through decided not to do it in wordpress.

What i’m concerned about are what drawbacks could be associated with this approach when it comes to search engines, indexing, seo etc.

What are other drawbacks or issues I should be thinking about that maybe I’m not?

Thanks in Advance!

  • 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-01T18:54:15+00:00Added an answer on June 1, 2026 at 6:54 pm

    I have no idea if this is a totally unorthodox approach

    There is nothing essentially “unorthodox” in using a query string to load various pages. Billions of sites using this approach. Search engines can index such pages all right.
    Nevertheless,

    I have one index.php page which always loads a header.php, sidebar.php, and footer.php.

    This is wrong concept.
    Having an index.php file only to load header and footer makes no sense and makes your site plainly unusable.

    Here are main faults in your design:

    1. You’re assuming that header.php would be called with the every page call. That’s wrong.
    2. You’re assuming that header.php will always be static. That’s wrong.
    3. You forgot to create a template for the page itself.

    The main rule everyone have to learn by heart:

    Not a single character has to be sent into browser, until all data gets ready.

    Why?

    • it’s 2012 today. AJAX era. What if your code will have to send JSONed data instead of whole HTML page?
    • there is a thing called HTTP header. Sometimes we have to send them. And it’s gets impossible if you already have your ornate HTML header sent.
    • Separating display logic from the business logic will let you use the same php code on many sites. You will have to change only templates and don’t touch engine files. That’s really great benefit.
    • Imagine you’re going to make a custom <title> tag for your pages, based on the page content. Isn’t it extremely common thing? But you can’t make it without using templates.

    So, you have to have one common site template containing header and footer and also dedicated templates for the every php script.
    And these templates have to be called only when all business logic is done – i.e. you have got all your data ready.

    An example layout is going to be like this:

    .1. page itself.

    it outputs nothing but only gathers required data and then calls a template:

    <?
    //include our settings, connect to database etc.
    include dirname($_SERVER['DOCUMENT_ROOT']).'/cfg/settings.php';
    //getting required data
    $DATA=dbgetarr("SELECT * FROM links");
    $pagetitle = "Links to friend sites";
    //etc
    //and then call a template:
    $tpl = "links.tpl.php";
    include "template.php";
    ?>
    

    .2. template.php which is your main site template,

    consists of your header and footer:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>My site. <?=$pagetitle?></title>
    </head>
    <body>
    <div id="page">
    <? include $tpl ?>
    </div>
    </body>
    </html>
    

    .3. and finally links.tpl.php is the actual page template:

    <h2><?=$pagetitle?></h2>
    <ul>
    <? foreach($DATA as $row): ?>
    <li><a href="<?=$row['link']?>" target="_blank"><?=$row['name']?></a></li>
    <? endforeach ?>
    <ul>
    

    this way you’d need no index with includes at all

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,

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.