title: php form redirects to different file instead of uploading SQL query
body: <p>I'm currently working on a webpage connected to a database for a football league. I constructed the page in the form of a table with a fixed header, menu, login bar and one cell (Main) which displays the page selected in the menu (for example, all the games' results when "Results" has been selected on the menu).</p>
  
  <p>Everything works neatly, until we arrive to the point where a page displayed in the main has two forms linked with the database. Every time, one of the submit buttons redirects my page to another position from the menu without performing the SQL query... What is odd is that if I load the concerned file alone on a webpage, all actions are performed... But when it is part of a bigger whole, it doesn't work properly.</p>
  
  <p>Here is the code for the cell which displays the Main content:</p>
  
  <pre><code>&lt;?php
  $id = $_REQUEST["id"];
  $lang=$_REQUEST["lang"];
  switch($id)
  {
  case 1:
  switch($lang){
      case pl: include "Main/PL/index.php"; break;
      case en: include "Main/EN/index.php"; break;
      default: include "Main/PL/index.php"; break;
  }; break;
  case 2:
  switch($lang){
      case pl: include "News/PL/index.php"; break;
      case en: include "News/EN/index.php"; break;
      default: include "News/PL/index.php"; break;
  }; break;
  case 3:
  switch($lang){
      case pl: include "Tables/PL/index.php"; break;
      case en: include "Tables/EN/index.php"; break;
      default: include "Tables/PL/index.php"; break;
  }; break;
  case 4:
  switch($lang){
      case pl: include "Results/PL/index.php"; break;
      case en: include "Results/EN/index.php"; break;
      default: include "Results/PL/index.php"; break;
  }; break;
  case 5:
  switch($lang){
      case pl: include "Fixtures/PL/index.php"; break;
      case en: include "Fixtures/EN/index.php"; break;
      default: include "Fixtures/PL/index.php"; break;
  }; break;
  case 6:
  switch($lang){
      case pl: include "Teams/PL/index.php"; break;
      case en: include "Teams/EN/index.php"; break;
      default: include "Teams/PL/index.php"; break;
  }; break;
  case 7:
  switch($lang){
      case pl: include "Contact/PL/index.php"; break;
      case en: include "Contact/EN/index.php"; break;
      default: include "Contact/PL/index.php"; break;
  }; break;
  default: 
  switch($lang){
      case pl: include "Main/PL/index.php"; break;
      case en: include "Main/EN/index.php"; break;
      default: include "Main/PL/index.php"; break;
  }; break;
  }
  ?&gt;
  </code></pre>
  
  <p>And here is one example of forms which perform badly - forms for Adding and Deleting players from a team:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;!-- First form for adding a player --&gt;
  &lt;h3&gt;Add a Player to Your Team&lt;/h3&gt;&lt;br&gt;
  &lt;form method='POST' action='index.php?id=6&amp;lang=en'&gt;First name: &lt;input type=\"text\" name=\"imie\"&gt;&lt;br&gt;
  Last name: &lt;input type=\"text\" name=\"nazwisko\"&gt;&lt;br&gt;
  &lt;input type='submit' name='dodaj' value='Add'&gt;&lt;/form&gt;&lt;br&gt;
  &lt;?php
  //what happens when button add player is selected   
  if ($_SERVER["REQUEST_METHOD"] == "POST"){
  if (isset($_POST['dodaj'])){
  //checks if data is input
  if (empty($_POST['imie']) || empty($_POST['nazwisko'])){
  echo "Provide the name of the player!";
  }
  else {
  //verify that the player has not already been added
  $imie=$_POST['imie'];
  $nazwisko=$_POST['nazwisko'];
  $sql="SELECT * FROM `Zawodnik` WHERE `Zawodnik_Imie`='$imie' AND `Zawodnik_Nazwisko`='$nazwisko'";
  $result=mysqli_query($conn, $sql);
  $czyjest=mysqli_num_rows($result);
      if ($czyjest &gt;= 1){
          echo "The player has already been added!";
      }
      else {
  //add the player
  $sql="INSERT INTO `Zawodnik`(`Zawodnik_Imie`, `Zawodnik_Nazwisko`, `Druzyna_Id_Druzyna`) VALUES ('$imie', '$nazwisko', '$iddruzyna')";
  $result=mysqli_query($conn, $sql);
  if (!$result){
      die ("Could not enter data ".mysqli_error($conn));
  }
  else {echo "Player added!";}
  }
  }
  }
  }
  ?&gt;
  &lt;!-- Second form for deleting a player --&gt;
  &lt;h3&gt;Remove Player&lt;/h3&gt;&lt;br&gt;
  &lt;form method='POST' action='index.php?id=5&amp;lang=en'&gt;ID nr: &lt;input type='number' name='id'&gt;&lt;br&gt;
  &lt;input type='submit' name='usun' value='Delete'&gt;&lt;/form&gt;&lt;br&gt;
  &lt;?php
  if ($_SERVER["REQUEST_METHOD"] == "POST"){
  if (isset($_POST['usun'])){
  //verify if the player ID has been input
  if (empty($_POST['id'])){
      echo "Provide Player ID!";
  }
  else {
  //Delete player
      $id=$_POST['id'];
      $sql="DELETE FROM `Zawodnik` WHERE `Id_Zawodnik`=$id AND `Druzyna_Id_Druzyna`=$iddruzyna";
      $result=mysqli_query($conn, $sql);
  if (!$result){
      die ("Could not delete data ".mysqli_error($conn));
  }
  else {
      $sql="SELECT * FROM `Zawodnik` WHERE `Id_Zawodnik`=$id";
      $result=mysqli_query($conn, $sql);
      $czyusuniety=mysqli_num_rows($result);
      if($czyusuniety&lt;1){
      echo "Player removed!";}
      else {
          echo "You can't remove a player from a different team!";
      }
  }
  }
  }
  }
  }
  
  mysqli_close($conn); 
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;    
  </code></pre>
  
  <p>Thanks for your help!</p>