ViciousCode
03-25-2009, 03:53 PM
Hello, I need help with this!
If i add this code on top.
<?php
$curdir = getcwd ();
chdir('forums');
require_once('global.php');
chdir ($curdir);
?>then this code wont work, the pages/content wont change, please help
<?php
//Include page header
include('header.php');
//Get the page variable
$page = $_GET['page'];
//Our switch statement to get the right content
switch($page) {
case "home": //For each page of content just add a case block
$content = "home.php"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.
case "news":
$content = "news.php";
break;
case "biography":
$content = "about-atb.php";
break;
case "album":
$content = "album.php";
break;
case "media":
$content = "media.php";
break;
case "interact":
$content = "interact.php";
break;
case "contact":
$content = "contact.php";
break;
case "blog":
$content = "blog.php";
break;
default: //If the variable didn't match any of the above cases do this.
$content = "home.php";
break;
}
//Include the selected content.
include($content);
//Include page footer
include('footer.php');
?>
If i add this code on top.
<?php
$curdir = getcwd ();
chdir('forums');
require_once('global.php');
chdir ($curdir);
?>then this code wont work, the pages/content wont change, please help
<?php
//Include page header
include('header.php');
//Get the page variable
$page = $_GET['page'];
//Our switch statement to get the right content
switch($page) {
case "home": //For each page of content just add a case block
$content = "home.php"; //The file with the page contents. DO not include the header and footer HTML in these files it is already added.
break; //Stop the case block, if you do not have this you will get an error.
case "news":
$content = "news.php";
break;
case "biography":
$content = "about-atb.php";
break;
case "album":
$content = "album.php";
break;
case "media":
$content = "media.php";
break;
case "interact":
$content = "interact.php";
break;
case "contact":
$content = "contact.php";
break;
case "blog":
$content = "blog.php";
break;
default: //If the variable didn't match any of the above cases do this.
$content = "home.php";
break;
}
//Include the selected content.
include($content);
//Include page footer
include('footer.php');
?>