title: CI: Undefined Variable
body: <p>I know similiar questions have been asked, but I've still been unable to resolve my issue.  When my view loads, I get the error below, and I know there is a value in $id.</p>
  
  <p>Message: Undefined variable: id
  Filename: admin/upload_form.php
  Line Number: 17</p>
  
  <p>Controller:</p>
  
  <pre><code>public function getEventNameById( $id ) {
              $q = $this-&gt;event_model-&gt;getEventNameById( $id );            
              echo "Event Name: ".$q."&lt;/p&gt;";
              $data['id'] = $id;            
              $this-&gt;load-&gt;view('admin/upload_form',array('error' =&gt; ' ' ), $data);
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;body&gt;
  &lt;div&gt;
  &lt;?php echo $error;?&gt;
  &lt;p&gt;Event Image:&lt;/p&gt;
  &lt;?php echo form_open_multipart('admin_upload/do_upload');?&gt;
  
  &lt;input type="file" name="userfile" size="20" /&gt;
  &lt;br /&gt;&lt;br /&gt;
  &lt;input type="hidden" id="iEventID" name="iEventID" value="&lt;?php echo $id;?&gt;" /&gt;
  &lt;input type="submit" value="upload event image" /&gt; &lt;input type="button" value="close" 
  onclick="window.close()"&gt;
  
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>What I need to be able to do, is query information based on an ID, then pass that ID to my view, which will then pass the ID back to a different controller function for use in updating a record in my database. In other words I need to persist the ID throughout.</p>
  
  <p>Any and all assistance is greatly appreciated.</p>