title: php session my post variable
body: <p>My <code>index.php</code> file performs operations on variables and if query has been succes, going to the <code>zamowienie.php</code> file. How can I now use these variables in the <code>zamowienie.php</code> file?</p>
  
  <pre><code>$kwota2 = $_POST['kwota2'];
  $zamowienie2 = $_POST['zamowienie2'];
  $var = $_POST['taskOption'];
  $nr_zamowienia2 = $_POST['nr_zamowienia2'];
  </code></pre>
  
  <p>so How can I pass them on to the session?</p>
  
  <pre><code>require_once "../produkty/php/connect.php";
  
          try {
              $polaczenie = new mysqli($host, $db_user, $db_password, $db_name);
              if ($polaczenie-&gt;connect_errno != 0) {
                  throw new Exception(mysqli_connect_errno());
              } else {
                  $polaczenie = new mysqli($host, $db_user, $db_password, $db_name);
  
                  $kwota2 = $_POST['kwota2'];
                  $zamowienie2 = $_POST['zamowienie2'];
                  $var = $_POST['taskOption'];
                  $nr_zamowienia2 = $_POST['nr_zamowienia2'];
  
                  if ($polaczenie-&gt;query("INSERT INTO zamowienia VALUES ('$nr_zamowienia2', '$zamowienie2', '$kwota2', '$var', 'Oczekiwanie')")) {
                      header('Location: zamowienie.php');
                  }
              }
  
              $polaczenie-&gt;close();
  </code></pre>