Right now I'm designing my own template with PHP. Trying to make it as easy to edit as possible in the future and right now its going well. I broke up the different parts into seperate PHP files and include them on the page.
I want one global file, called "strings.php" that will hold the primary data of the theme, so I only need to edit it once and can edit them all in the same place.
I have one called "style.php" which is basically a stylesheet with variables, that works great but doesn't require what I'm looking for...
I'm trying to include the "strings.php" variables on all of the pages that I am using and will use in the future. So I put the include near the top of my page which looks like this so far:
I'm thinking PHP parses the includes before it includes them. Even if I redeclare the variables in the index.php the other included files don't work.
Is the only other option to include "strings.php" in each include file?
I want one global file, called "strings.php" that will hold the primary data of the theme, so I only need to edit it once and can edit them all in the same place.
I have one called "style.php" which is basically a stylesheet with variables, that works great but doesn't require what I'm looking for...
I'm trying to include the "strings.php" variables on all of the pages that I am using and will use in the future. So I put the include near the top of my page which looks like this so far:
PHP:
/* INDEX.php */
<?php
include "inc/strings.php"; // This file is where you will edit the title, subtitle, page names etc. of the site
?>
<title><?php echo $global_sitename ?></title> // Works fine
/* STRINGS.php */
<?php
$global_sitename = "rads site";
$global_title = "Rad's Site";
$global_subtitle = "Welcome to my website";
?>
/* HEADER.php */
<div id="topleft" class="left">
<?php $title; ?> //Value is ''
<BR />
<?php $subtitle; ?> //Value is ''
</div>
I'm thinking PHP parses the includes before it includes them. Even if I redeclare the variables in the index.php the other included files don't work.
Is the only other option to include "strings.php" in each include file?