title: variable is not set & form submission error question
body: <p>Having a little bit of trouble with this section of code: </p>
  
  <pre><code>if(!empty($_POST['RemoveRequest']) &amp;&amp; isset($_POST['RemoveRequest'])){ $action = $_POST['RemoveRequest']; }
  echo '&lt;form method="post" action="'.$page_name.'"&gt;
  &lt;input type="submit" value="[Remove Request]" name="RemoveRequest" /&gt;&lt;/form&gt;&lt;/td&gt;'
  .'&lt;/tr&gt;&lt;/table&gt;';
  
  if($action == 'RemoveRequest'){
  
  $sql = "DELETE FROM ".TBL_FACTION_REQUESTS." WHERE r_id=$id LIMIT 1";
  mysql_query($sql);
  header("Location: ".$page_name."");
  
  }
  </code></pre>
  
  <p>This form and server code is throwing this error:</p>
  
  <blockquote>
    <p>Notice: Undefined variable: action in C:\xampp.. on line 97.</p>
  </blockquote>
  
  <p>Then the record isn't deleted from my DB.</p>
  
  <p>I'm really confused at what i'm doing wrong here? Tried a bit of debugging myself, but haven't had any luck yet. Hoping someone can help me out!</p>