Hey all i need some assistance. I am trying to progam a web app that doesn't change page it justs populates the main content area with extenal pages.
The way it works is it takes the content files and show them after the url is
index.php?p=<mod name>&s=<the page the module is using>
the only problem is the get content feature is spitting out
Fatal error: Call to undefined function getContent() in /home/andreffx/public_html/dev/index.php on line 136
the code on that line is
<?php getContent(); ?>
the index.php includes the the file inc/functions.php which contains the following:
<?php
include ('inc/config.php');
function getContent() {
global $p;
global $s;
global $c_path;
global $c_error;
$p_page = $c_path.$p.'.php';
$s_page = $c_path.$p.'/'.$s.'.php';
if (is_file($s_page)) {
$inc_page = $s_page;
} else {
if (is_file($p_page)) {
$inc_page = $p_page;
} else {
echo $c_error;
}
}
if (isset($inc_page)) {
include($inc_page);
}
}
?>
this file includes config.php wich is as follows.
<?php
if (isset($_GET['p']) && $_GET['p'] != '') {
$p = $_GET['p'];
} else {
$p = 'home';
}
if (isset($_GET['s']) && $_GET['s'] != '') {
$s = $_GET['s'];
}
$c_path = 'mods/';
$c_error = '<li class="red"><span class="ico"></span><strong class="An error has occured, Please notify your I.T Manager</strong></li>;
?>
I really need this to work so i can start my dev again.
Please Help.