title: task involving $_GET, $_POST, and redirects (header())
body: <p>this is the situation I am in:</p>
  
  <p>I currently have 3 pages:</p>
  
  <ul>
  <li><p><strong>people.php</strong> , which is a page in which users can select the user they want to follow and when they click the user they are following them.  each person is linked to follow.php, but the variable username is posted in the link to a different value depending on which is pressed.  ie if anderson cooper is selected, the link that is triggered is follow.php?username=andersoncooper;</p></li>
  <li><p><strong>follow.php</strong> , which is a page which is triggered when the user selects the person they want to follow, and this page goes through and follows the person.  This page only works if the user is logged in.  The page GETs the variable username (<code>$username = $_GET['username']</code>), value depending on which link was selected.  Next this username variable is put into the function which follows the user.</p></li>
  <li><p><strong>Login.php</strong> , which is a page which allows the user to login on twitter and authorize the app.  I have put code on the top of follow.php that says if the user is not logged in, send them here.  when login.php is done and the user is done, they are sent back to follow.php.  The only problem is the variable username is no longer defined.  I tried setting the variable (<code>$username = $_GET['username']</code>) before the redirect to the login page if the user is not logged in but this doesn't work.  for the redirect, I am using this:</p></li>
  </ul>
  
  <pre class="lang-php prettyprint-override"><code>if(empty($_SESSION['oauth_token'])){
      //not signed in
      die(header( 'Location: twitter_login.php' )) ;
  }
  </code></pre>
  
  <p>I tried using this script without the die as well and it still didn't work.  The rest of the <code>follow.php</code> code follows this check.  I hope I explained my problem well.  The script works perfectly if the user is already logged in because the login.php never gets called and you never leave follow.php.  But when you leave the page you can not GET['username'].  Anyone know what the solution to this is?  Thank you!!</p>