Forum Moderators: coopster
However, i want to be able to include a config file on top of the template that includes some variables for various bits on the other pages, that are sometimes repeated on each page but not every page. Like the title for example, some pages have similiar titles, some dont. I'd like to be able to have the similiar title bit as a variable, and then stick that in each page in the title bit, where it hopefully echos out on the page. Does that actually make any sense whatsoever? :P
However, when i try this, it doesn't work, all i see in the title in the browser is
$pagetitle blah blah blah
and on the top of the page in the source code is the php include for the config file
<?php
include ('config.php');
?>
Same goes for any other php in the template, such as a data stamp, it doesn't display, but yet the php code is in the source code
Why is this doing this and is there anyway around this?
thanks
:)
>> if you want to pass variables from or to an 'included' script, you need to use require instead
my apologies but that is not true, include and require work the same way except for how they fail
[php.net...]
The documentation below also applies to require(). The two constructs are identical in every way except how they handle failure. They both produce a Warning, but require() results in a Fatal Error. In other words, use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless.