Question Locked

How to use variables in my PHP website header file.

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I'm trying to use PHP variables so that I can use my header file to display the menu on all my webpages, however, I wanted to be able to change a line of text on each page by setting a variable for the php header to use for each page so for example:

I have my php header file and in it I have a the line

Company Name - <?php $var ?>

and on each individual page I have something like:

does anyone have any ideas why this may not be working? Or any ideas on a different approach to this?

Thanks in advance

-CK

3 replies

by chad.klunk

I'm sorry I guess I need to put quotes or something around my PHP example...

in the php header file that has my menu i have the following line.

"Company - <php? $var>"

in the individual webpages i have this line of code:

""

This discussion is closed to new replies.