title: How to use $_GET?
body: <p>I have the following login script, where i do use sessions.</p>
  
  <pre><code>&lt;?php
  session_start();
  if(isset($_SESSION['logged_in'])){
      $id = $_SESSION['id'];
      header("Location: start.php?id=$id");
      exit();
  }
  
  if(isset($_POST['submit'])){
  
      $x1 = $_POST['x1'];
      $x2 = $_POST['x2'];
  ...
  $query = $db-&gt;query("SELECT * FROM table WHERE x1='".$x1."' AND x2='".$x2."'");
          if($query-&gt;num_rows === 1){
  
              $row = $query-&gt;fetch_object();
              $id = $row-&gt;id;
  
                          $_SESSION['logged_in'] = true;
              $_SESSION['id'] = $id;
              header("Location: start.php?id=$id");
  
                          3more queries
                          exit();
  </code></pre>
  
  <p>start.php will be just:</p>
  
  <pre><code>&lt;?php
  echo $_GET['id'];
  ?&gt;
  </code></pre>
  
  <p>I thought $_GET['id'] would be stored on the server so that $_GET should be displayed. The fetch_object is working. I know that, because it will be displayed the right way at "id=$id" at the browser. So would someone be that friendly and could help me out. Thanks!</p>