Tristan Tristan - 1 year ago 68
PHP Question

How do I assign a HTML title to different pages?

I am developing a website with oure PHP and HTML on an Apache server. No CMS.

All of my website's pages from the main directory and its subdirectories call one


I have now run into an issue with all of the page
's, as these are obviously defined in the header, so now I don't know how to set a different title for each page.

Can anyone help?

Answer Source

What I usually do is have the title tag like this:

<title><? echo $titleIs ?></title>

Then, on each page, before the header include, set the title:

<? $titleIs='Page Title' ?>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download