Dynamic titles best way?
<p>header.php</p>

<pre><code>&lt;?php

$conn = mysql_connect('localhost', '-', '-');
@mysql_select_db('accmaker', $conn) or die("Unable to select database");

?&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Mysite.com - &lt;?php isset($pageTitle) ? $pageTitle : 'Home'; ?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
</code></pre>

<p>profile.php</p>

<pre><code>require 'header.php';

$q = mysql_query("SELECT * FROM users WHERE username = '$username'");

$r = mysql_fetch_assoc($q);

$pageTitle = "Profile of $r[username]";
</code></pre>

<p>I think you understand what i want</p>

<p>I cant include header.php after the query, because i wont be connected to mysql</p>

<p>waht do you suggest other than having the connection snippet on every page</p>
