Thanks much for all the help.
You can see I am new at this. The simplifications to the code and reducing unnecessary tags are helpful and I will put those in once I get the darn thing to work. Which at the moment I can’t, for the life of me.
So: at the moment, neither header.php not footer.php do any testing or setting of $landingpage on entry. They still need to test the value to execute the
index.php has the following at startup:
<?php
$landingpage = isset($_SESSION["landingpage"]) ? $_SESSION["landingpage"] : "index.php" ;
include "header.php";
?>
There is no login or anything like that. I assume that generally people will arrive at index.php since that is where we are mostly listed at, but for special cases we want to make available index_a.php, index_b.php, etc. People who enter with those should continue to see index_a.php, index_b.php so long as they continue to navigate the site. They should not see index.php. Should be simple I guess.
If that is the case, then both index_a.php and index.php should contain session_start() … if I am understanding this correctly … since a user will never execute both, only one or the other, in a single session.
index_a.php has the following at startup:
<?php
session_start();
$_SESSION["landingpage"] = "index_a.php";
$landingpage = isset($_SESSION["landingpage"]) ? $_SESSION["landingpage"] : "index_a.php" ;
include "header.php";
?>
index.php has the following at startup:
<?php
$landingpage = isset($_SESSION["landingpage"]) ? $_SESSION["landingpage"] : "index.php" ;
include "header.php";
?>
We’ll assume at this point that all we want to do is get it to work for the user who enters the system at index_a.php.
So: we execute index_a.php, then click home. We still end up getting index.php. The actual selector, which is in header.php, is still as it was in my previous post; I have not yet tried to simplify it, but it should work as is, no ?
What am I STILL missing ? Feeling like an idiot.