PHP Date Redirect

April 16, 2004

In-case anyone ever needs something like this. Here is my feeble little PHP script to redirect via a date. The date is configured using the PHP date parameters.

<br /> <?php $date= date("Y/m"); Header("Location: $date/index.php"); echo " "; // IF THIS ISN'T HERE NETSCAPE4 STALLS exit(); ?><br />

I’m using this for our new class portal. You can see how it works there, just hit the main page and you’re transfered to the current month’s archive. I wanted something like this for asp, but it seemed to take 50 lines and never quite worked like I wanted.

Honestly, I wanted something like this, so I wouldn’t have to rebuild that weblog on the 1st of each month in order to see the current month’s events or calendar. I’m doing that on our current Events & Classes page and it’s not the best approach.