Like this…
echo $title;
$title = 'Jelly';
I only ask because I have a header file before that I declare the $title, on some of my pages though the page has different sections using a simple $_GET[‘tab’] === ‘blahblahblah’;
But these $_GET variables are declared after I have called the header file…
that’s what you’re doing wrong.
Call your header only after you’ve got all necessary data.
You need proper site architecture for this.
Divide your code into 3 parts:
Ans with this setup you’ll never run into problem like this.
A typical script may look like
where
main.tpl.phpis your main site template, including common parts, like header, footer, menu etc:and
links.tpl.phpis the actual page template: