Outside variable to work with include function
Posted: Tue Mar 07, 2006 3:53 pm
The way I have my index.php file start is:
common.inc.php includes all of my includes and classes, such as page.inc.php:
I can't get it to recognize the variable $pagename, which I need for the title, nav, etc.
Code: Select all
<?php
$pagename = "Home";
require_once("include/common.inc.php");
page_header();
?>Code: Select all
<?php
session_start();
// Start Header
function page_header() {
?>
<?php
echo "$pagename";
?>