Posted By

robnilas on 01/21/17


Tagged

redirect php-redirect


Versions (?)

PHP Redirect in exact time - v3


 / Published in: PHP
 

  1. <?php
  2. //March 21, 2014 at 18:20 GMT
  3. date_default_timezone_set('GMT');
  4. $target = strtotime("March 21, 2014, 18:20");
  5. $date = strtotime(date("F j, Y, g:i a"));
  6. //IMPORTANT: This must be at the top of your page1.html before anything is sent to browser!
  7. if($date>=$target){
  8. header("location: page2.html");
  9. }
  10. ?>

Report this snippet  

You need to login to post a comment.