title: Undefined Variable in php
body: <p>I have inherited some code for a custom CMS that is a little out of my league and keep stumbling over the same errors, Notice: Undefined variable: media in /Applications/MAMP/htdocs/Chapman/Chapman_cms/admin/team-2.php on line 48. This is supposed to create new users and edit old users. However, it does not work when I try and add a new user.</p>
  
  <p>Below is the pertinant code:</p>
  
  <pre><code>$db = new database("mysql",$dbHost,$dbName,$dbUser,$dbPass);
  $target = 'add';
  if ($_GET['task'] == 'edit') {
  $media = $db-&gt;get_row(edit_media_item($db, $_GET['team_id']));
  $target = 'update';
  
  &lt;p&gt;&lt;label for="copy"&gt;Full Name:&lt;/label&gt;
      &lt;input type="text" name="title" value="&lt;?=$media['title']?&gt;" /&gt;
      &lt;textarea name="media" id="media" cols="30" rows="5" style="width: 100%"&gt;&lt;?=$media['copy']?&gt;&lt;/textarea&gt;&lt;/p&gt;
      &lt;input type="hidden" name="process" value="&lt;?=$target.",copy,4,team-1,".$media['id'].""?&gt;"&gt;
      &lt;p&gt;&lt;input type="submit" name="save" value="Submit" /&gt;
      &lt;input type="reset" name="reset" value="Reset" /&gt;&lt;/p&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Any help would be much appreciated.</p>