includes and keywords

hello good people, i hope i can explain my problem/question/request
properly,

when i create websites i use 'includes' to bring in the headers menus
footers etc.

what i was wondering was, is there a way to tell the header which page it is
being included in, and then make the header include the relevant keywords
for that page?

ie page1 includes header - header gets keywords for page1
page2 includes header - header gets keywords for page 2


i am a bit of a jargon free zone so please be gentle with me
thank you
kev
mr rudeforth [ Mo, 02 Juli 2007 11:45 ] [ ID #1757612 ]

Re: includes and keywords

On Jul 2, 5:45 am, "mr rudeforth" <m... [at] no.co.uk> wrote:
> hello good people, i hope i can explain my problem/question/request
> properly,
>
> when i create websites i use 'includes' to bring in the headers menus
> footers etc.
>
> what i was wondering was, is there a way to tell the header which page it is
> being included in, and then make the header include the relevant keywords
> for that page?
>
> ie page1 includes header - header gets keywords for page1
> page2 includes header - header gets keywords for page 2
>
> i am a bit of a jargon free zone so please be gentle with me
> thank you
> kev

Rather than tell the header which page he's being included in, I would
simply define the keywords on the page itself before including the
header. So, something like this:

page.php:
<?php
$keywords = array('foo', 'bar', 'baz');
include('header.php');
....
?>

header.php:
<?php
if(isset($keywords)) {
//do what you want with the keywords
}
....
?>
zeldorblat [ Mo, 02 Juli 2007 16:03 ] [ ID #1757613 ]

Re: includes and keywords

"ZeldorBlat" <zeldorblat [at] gmail.com> wrote in message
news:1183385033.884913.287350 [at] k79g2000hse.googlegroups.com.. .
> On Jul 2, 5:45 am, "mr rudeforth" <m... [at] no.co.uk> wrote:
> > hello good people, i hope i can explain my problem/question/request
> > properly,
> >
> > when i create websites i use 'includes' to bring in the headers menus
> > footers etc.
> >
> > what i was wondering was, is there a way to tell the header which page
it is
> > being included in, and then make the header include the relevant
keywords
> > for that page?
> >
> > ie page1 includes header - header gets keywords for page1
> > page2 includes header - header gets keywords for page 2
> >
> > i am a bit of a jargon free zone so please be gentle with me
> > thank you
> > kev
>
> Rather than tell the header which page he's being included in, I would
> simply define the keywords on the page itself before including the
> header. So, something like this:
>
> page.php:
> <?php
> $keywords = array('foo', 'bar', 'baz');
> include('header.php');
> ...
> ?>
>
> header.php:
> <?php
> if(isset($keywords)) {
> //do what you want with the keywords
> }
> ...
> ?>


ok cheers i will give it a go, but i may be back if (as is likely) i get
slightly confused. thanks again
mr rudeforth [ Di, 03 Juli 2007 10:00 ] [ ID #1758689 ]
PHP » alt.php » includes and keywords

Vorheriges Thema: mkdir() and safe_mode
Nächstes Thema: Abstract classes