Forum Moderators: coopster
<?php
$inc = $_SERVER["DOCUMENT_ROOT"]."/inc";
include $inc."/config.php";
include $about."/setup.php";
include $inc."/header.php";
include $inc."/topnav.php";
include $inc."/left.php";
include $inc."/right.php";
if(!$_SERVER['QUERY_STRING']) {?>
<div id="content">
<H2>Our Mission</H2>
<p>We will continue our efforts to widen our scope to include....
</div>
<? } elseif ($_SERVER['QUERY_STRING'] == "bio") {?>
Ipsum Lorum.....
<? }
include $inc."/footer.php";?>
All that is wrong...correct me...is that the absolute coding is wrong.
This works:
<?
include( '../inc/config.php' );
include( 'setup.php' );
include( '../inc/header.php' );
include( '../inc/topnav.php' );
include( '../inc/left.php' );
include( '../inc/right.php' );
include( '../inc/footer.php' );
if(!$_SERVER['QUERY_STRING'])?>
<div id="content">
<H2>Our Mission</H2>
<p>We will continue our efforts....</p>
</div>
<? } elseif ($_SERVER['QUERY_STRING'] == "contact") {?>
<div id="content">
<H2>Contact Info</H2>
<p>Our address is....</p><? )
include( '../inc/footer.php' );
?>
This worls but ...How could I use absolute includes?
public_html
=>inc
=>=>config.php
=>about
=>=>index.php
So yes, it should be
include($_SERVER['DOCUMENT_ROOT'] . '/inc/config.php');
include($_SERVER['DOCUMENT_ROOT'] . '/about/index.php');
If it's not working, echo out the paths and see if you are missing something:
$path = "path/to/page/";
echo $path;
include($path);