title: PHP. How to pass variable and auto redirect to another PHP file
body: <p>I'm developing app for <em>Facebook</em>. Here when user open application should be checked If user already exists in database. I think I will use <code>$_SESSION</code>to pass <em>user's Id</em> to <code>checkIfExsists.php</code></p>
  
  <p>So my <em>FacebookGetId.php</em> looks like:</p>
  
  <pre><code>&lt;?php
  ...
  $id = $user_profile['id'];
  $_SESSION['id'] = $id;
  ?&gt;
  </code></pre>
  
  <p>So <code>$id</code> for now is i.e. <code>'12345'</code> I just don't know how to make automatically redirect to <code>checkIfExsists.php</code> to check If that Id already exsists in database.</p>
  
  <p>It should be something like: When application is launched, It should take <em>User's Id</em> and automatically redirect to <code>checkIfExsists.php</code>and pass that Id.</p>
  
  <p>If user exists <code>checkIfExsists.php</code> should redirect user to <code>application.php</code>, if not exists - It should redirect to <code>registration.php</code></p>