Jump to content

[SOLVED] Content Not Loading Based on Page ID


AlkaSeltxer

Recommended Posts

What I'm trying to do is get a php file with content to load into my basic page template based on the page id, however it's not loading anything, however there are no errors coming up. I've looked everywhere I could find, and tried everything I could think of. I really could use some help on this. Below is the page template code and the code I'm trying to use to get the content to load up.

 

page_templ.php

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" type="text/css" href="templates/content/style.css" >
<!--This is the css used for IE because we need to correct some things for it.-->
<!--[if IE]>
  <style type="text/css">
    @import 'templates/content/styleIE.css';
  </style>
<![endif]-->
</head>
  <body>
    <?php
    //We need to load our language files with our common text varibles
      require("content/langeng.php");
    ?>
    
<div id="header">
      <?
      //Lets show the header. I use html where I can so smartphones load as little advanced code as possible
        require_once("header.php");
      ?>
</div>

<div id="menu">
      <?//Now our menu.
        require_once("menu.php");
      ?>
</div>

<div id="mbody">
      <?//Now the primary site content.
        //Load up our postvars.php file
        require_once("content/postvars.php");
      ?>
</div>
  </body>
</html>

 

postvars.php

<?php
$id  =  $_POST["id"];
if ( $id == "home" ) {
include 'main_c.php';
}
elseif ( $id == "guides" ) {
include  'guides_c.php';
}
elseif ( $id == "trips" ) {
include  'trips_c.php';
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.