How to fix this PHP error?
<p>I have a header method that shows in the top of a page, it is inside a class, inside my header() method I run this code here to start a new Profiler object...  </p>

<pre><code>//start new page timer object
$profiler = new Profiler;
$profiler-&gt;start();
</code></pre>

<p>After a bunch of other files are compiled, I then include a file into the footer section, in this file I run this code,  </p>

<pre><code>echo 'Page Generated in ' .$profiler-&gt;end(). ' of a second with ' .$_SESSION['querie_counter']. ' MySQL Queries';
</code></pre>

<p>However I am getting this error message in the footer file now,  </p>

<blockquote>
  <p>Notice: Undefined variable: profiler
  in
  C:\webserver\htdocs\friendproject2\includes\footer.inc.php
  on line 21</p>
  
  <p>Fatal error: Call to a member function
  end() on a non-object in
  C:\webserver\htdocs\friendproject2\includes\footer.inc.php
  on line 21</p>
</blockquote>

<p>How can I fix this?</p>
