title: Php object is not visible to html subtemplate?
body: <p>Im a complete noob to PHP but have a decent working knowledge of OO. I'm working on a project the displays a persons profile.
  I have a <strong>profile.php</strong> which takes a patient's id number and creates a person object and then renders an html template below. The html template is supposed to display the patient's vitals and other information. I have three inserts, two of which work. </p>
  
  <p>the problem i am having is that  in my <code>profile.php</code> I create a <code>$person</code> object and I have verified this works by outputting the $person's full name and id. However when render the html template <code>profile.html</code> .... $person does not seem to be visible there specifically it is the <code>/inserts/_patient_form.php</code> which does not seem to be able to access my <code>$person</code> object. Is there something I'm doing wrong? Still trying to understand the various quirks of php.... should I be declaring something global?</p>
  
  <p><strong>profile.php</strong></p>
  
  <pre><code>&lt;?php 
  
  include_once('../mysql_connect.php');
  include_once('includes/classes/person.php');
  include_once('includes/classes/stats.php');
  include_once('includes/classes/note.php');
  include_once('includes/classes/prescription.php');
  include_once('includes/functions.php');
  
  
    //Define the query
  if (isset($_GET['patient']) &amp;&amp; is_numeric($_GET['patient']) &amp;&amp; ($_GET['patient'] &gt; 0)){
  
  
  
  
  $person = Person::find_by_id($_GET['patient']);
  
  $name = $person-&gt;getFullName();
  $id = $person-&gt;getId();
  
  define('TITLE', $name . '\'s Profile');
  include('templates/header.html');
  include('templates/profile.html');
  include('templates/footer.html');
  
  
  } else { // Couldn't get the information
  define('TITLE', 'Invalid Profile');
  include('templates/header.html');
  print '&lt;p class="error"&gt;This is an invalid page, or this patient doesn\'t exist..&lt;/p&gt;';
  include('templates/footer.html');
  }
  
  mysql_close($dbc);// Close the connection
  ?&gt;
  </code></pre>
  
  <p><strong>profile.html</strong></p>
  
  <pre><code>&lt;h2 style="margin-bottom:10px;"&gt;&lt;?php print $name ?&gt;&lt;/h2&gt;
    &lt;p id="message"&gt;&lt;/p&gt;
    &lt;ul class="nav nav-tabs" id="patient-tabs"&gt;
     &lt;li class="active"&gt;&lt;a href="#statistics" data-toggle="tab"&gt;Statistics&lt;/a&gt;&lt;/li&gt;
     &lt;li&gt;&lt;a href="#notes-prescriptions" data-toggle="tab"&gt;Notes and Prescriptions&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#profile" data-toggle="tab"&gt;Profile&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  
      &lt;div class="tab-content"&gt;
   &lt;div class="tab-pane active" id="statistics"&gt;
      &lt;?php include('inserts/_patient_entries.php'); ?&gt;
    &lt;/div&gt;
    &lt;div class="tab-pane" id="notes-prescriptions"&gt;
    &lt;?php include('inserts/_patient_notes.php'); ?&gt;
    &lt;/div&gt;
    &lt;div class="tab-pane" id="profile"&gt;
      &lt;?php include('inserts/_person_form.php'); ?&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>/inserts/_patient_form.php</strong>
      
  
  <pre><code>print '
    &lt;form class="form-horizontal" action="ajax/person_update.php" id="patient-form"&gt;
    &lt;input name="id" type="hidden" value="' . $person-&gt;getId() . '" required=""&gt;
  
    &lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;First Name&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input id="first_name" name="first_name" type="text" value="' . $person-&gt;first_name . '" class="input-xlarge" required=""&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;Last Name&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input id="last_name" name="last_name" type="text" value="' . $person-&gt;last_name . '" class="input-xlarge" required=""&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;Email&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input id="email" name="email" type="text" value="' . $person-&gt;email . '" class="input-xlarge" required=""&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;Phone&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input id="phone" name="phone" type="text" value="' . $person-&gt;phone . '" class="input-xlarge"&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;Age&lt;/label&gt;
      &lt;div class="controls"&gt;
     &lt;input id="age" name="age" type="text" value="' . $person-&gt;age . '" class="input-xlarge" required=""&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
  &lt;label class="control-label"&gt;Address&lt;/label&gt;
      &lt;div class="controls"&gt;                     
        &lt;textarea id="address" name="address" rows="5" cols="300" style="width:270px;"&gt;' . $person-&gt;address . '&lt;/textarea&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
  &lt;label class="control-label"&gt;Insurance&lt;/label&gt;
  &lt;div class="controls"&gt;                     
    &lt;textarea id="insurance" name="insurance" rows="5" cols="300" style="width:270px;"&gt;' . $person-&gt;insurance . '&lt;/textarea&gt;
  &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;New Password&lt;/label&gt;
      &lt;div class="controls"&gt;
        &lt;input id="password" name="password" type="password" value="" class="input-xlarge"&gt;
  
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div class="control-group"&gt;
      &lt;div class="controls"&gt;
        &lt;button id="singlebutton" type="submit" name="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;/form&gt;
  ';
  ?&gt;
  </code></pre>