title: Redirect a page if timestamp in URL string is expired
body: <p>I've pieced together some code by looking at <a href="https://stackoverflow.com/questions/29789025/how-to-redirect-users-based-on-random-url-string">this post</a> and <a href="https://stackoverflow.com/questions/9493167/display-content-based-on-date-with-php">this post</a>. But I didn't quite get it.</p>
  
  <p>I want to include a timestamp in my url and check to see if 2 months has passed from the timestamp. If we are within the 2 months, display the page normally. If more than 2 months has passed, redirect the page. </p>
  
  <p>Here's what I have so far but it's not working. Any suggestions on how I can get this working properly?</p>
  
  <pre><code>//test timestamp... this will come from the url as so: www.mywebsite.com?ts=1340037073
  $timestamp = echo $_GET['ts'];
  
  //check if it has expired (in seconds, 5256000 sec = 2 months).
  if ((time() - $timestamp) &lt; 5256000)
  {
  echo 'valid';
  }
  else
  {
  Header("Location: http://www.google.com");
  }
  </code></pre>