echo problems w/ included pages
Hello all,
I've been trying to define variables (e.g., meta tags) on a page, then include another page (e.g., a <head> section) that echos them.
I've had success doing it all on one page, like so:
Code:
<?php $page['keywords'] = "these, are, my, keywords" ?>
<html>
<head>
meta name="keywords" content="<?php echo $page['keywords'] ?>"
</head>
etc...
As expected, I get this:
Quote:
meta name="keywords" content="these, are, my, keywords"
However, when I try to separate the pages it doesn't work out so well.
webpage.php:
Code:
<?php $page['keywords'] = "these, are, my, keywords";
include ("path/to/htmlhead.php"); ?>
<body>
...page content...
</body>
</html>
htmlhead.php:
Code:
<html>
<head>
meta name="keywords" content="<?php echo $page['keywords'] ?>"
</head>
When I look at the source of webpage.php, I just get this in the <head> section:
Quote:
meta name="keywords" content=""
The page/site I'm working on is here.
Can anyone help me out? Thanks in advance, guys.