title: PHP undefined Index ($_GET)
body: <p>Hello there I have some problem with my code:</p>
  
  <pre><code>if (!empty($_GET['id'])){
      $id = $_GET['id'];
  }else if (!empty($_POST['id'])){
      $id = $_POST['id'];
  }
  
  $get_id = 'SELECT * FROM kunde WHERE id=' . $id;
  $r = mysql_query($get_id);
  $t = mysql_fetch_array($r);
  
  $_SESSION['id'] = $t['id'];
  </code></pre>
  
  <p>I also have my hidden field:</p>
  
  <pre><code>&lt;input type="hidden" name="id" value="&lt;?php echo $_SESSION['id']; ?&gt;"&gt;
  </code></pre>
  
  <p>But I got always the same error:</p>
  
  <pre><code>Notice: Undefined variable: id in C:\xampp\htdocs\Uebungsklausur\PHP\change.php on line 30
  
  Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Uebungsklausur\PHP\change.php on line 32
  </code></pre>
  
  <p>Please help me guys.. I just want to get the ID's from the table "kunde"</p>
  
  <p>EDIT: Thank you guys I solved it. The problem was in the form tag. That was the first code: <code>&lt;form method="post"&gt;</code>
  And now it's: <code>'&lt;form method="post" action=" change.php?id=' . $row[0] . '"&gt;';</code> </p>