Using php include for web page title tag
Posted: Wed Mar 03, 2010 8:49 pm
Hi,
I am an absolute beginner to php but have over 10 years experience in html and web design. I have worked with many sites using php but cannot actually write any myself.
My question is - and I have scoured google and forums and tutorials but cannot find an answer or how to do this -
I have the following code in the title tags of my web pages:
&
and the following code in a lang.php file
This is my first basic (okay - stop laughing - at least it works
) php scripting and I would like to know how to do this properly without having to have the before every echo statement.
Thanks,
aussiewebgirl

I am an absolute beginner to php but have over 10 years experience in html and web design. I have worked with many sites using php but cannot actually write any myself.
My question is - and I have scoured google and forums and tutorials but cannot find an answer or how to do this -
I have the following code in the title tags of my web pages:
Code: Select all
<title><?php include('includes/lang.php'); echo "$title_mainpage"; ?></title>Code: Select all
<title><?php include('includes/lang.php'); echo "$title_anotherpage"; ?></title>and the following code in a lang.php file
Code: Select all
$title_mainpage = "My great web page";Code: Select all
$title_anotherpage = "My other great web page";Code: Select all
php include('includes/lang.php');Thanks,
aussiewebgirl