I have a website which includes a footer on every page. I want the text in the footer to change depending on what page they are on.
The only way I have come up with would be to create a session to see what page they are on, use the session in a comparative if
statement and then destroy it upon exit.
My question: Is there an easier way to change my footer text content, based upon the current page the user is on?
if(isset($_SESSION['at_index']))
{
$login = "<p>Already registered? <a href='login.php'>Sign in</a></p>";
}
if(isset($_SESSION['at_login']))
{
$login = "<p>Forgotten your password? <a href='reset_password.php'>Reset</a> your password!</p>";
}
$footer = <<<FOOTER
<div id='footer'>
$login
</div>
FOOTER;
?>