How to set page title in single page site
<p>Hi I have a single page ajax website the single page is basically loading all the pages I would like to set the page title depending on the current view.</p>

<p>I have tried using this </p>

<pre><code>&lt;title&gt;&lt;!--TITLE--&gt;&lt;/title&gt;
    &lt;?
$pageContents = ob_get_contents (); // Get all the page's HTML into a string
ob_end_clean (); // Wipe the buffer

// Replace &lt;!--TITLE--&gt; with $pageTitle variable contents, and print the HTML
echo str_replace ('&lt;!--TITLE--&gt;', $pageTitle, $pageContents);
?&gt;
</code></pre>

<p>I have then added the titles to the page links like this </p>

<pre><code>  &lt;li class="menu-link"&gt;
        &lt;a href="index.php?page=home"&gt;&lt;img src="images/menu/home.png" width="72" height="72" alt="Home" /&gt;Home&lt;/a&gt;
        &lt;?php $pageTitle = 'Saunders-Solutions Freelance Design and Development'; ?&gt;
    &lt;/li&gt;
    &lt;li class="menu-link"&gt;
        &lt;a href="index.php?page=about"&gt;&lt;img src="images/menu/about.png" width="72" height="72" alt="About" /&gt;About&lt;/a&gt;
        &lt;?php $pageTitle = 'About Saunders-Solutions Freelance Design and Development';  ?&gt;
    &lt;/li&gt;
</code></pre>

<p>however it always shows the same title for all pages any help appreciated </p>
