Forum Moderators: coopster
I have a basic index page structure like this:
<?php
$page = $_GET['page'];
if (!$page) {
$page = "home";
}
include_once("header.php");
include_once("content/".$page.".php");
include_once("menu.php");
include_once("footer.php");
?>
there are several PHP docs in the contents folder. in the header i want certain scripts only to load with a certain page so i did this in the header.php file:
<?php
if ($page = "portfolio") {
include_once("content/portScripts.php");
}
?>
I was hoping that, the file "portScripts.php" would only load when the page selected had the variable "portfolio" in the URL.
the thing is, it loads "portscripts.php" just fine, but every page has the "portfolio" content, no matter what the $page is in the URL it always comes up portfolio now.
before I added this IF statement to the header.php everything worked just fine. it seems somehow i made the $page variable always be "portfolio"
let me know if i need to include more info.
Thanks!