Need a PHP Redirect Script with multiple conditions
Posted on 2006-05-20
I am needing a script for a school homework help site. I'm good at working with existing PHP, but I can't find very many references to do what I need for this one.
I need a PHP redirect script that triggers on one of multiple conditions, as follows, in order of precedence:
1) Day of the year (for special days, such as holidays)
a) For Christmas, which will cause the site to redirect between 12/24 and 01/02 of each year.
b) For Thanksgiving (we can modify it to correct date every year).
c) For July 4
d) Generic single day so we can add other days of the year as desired.
e) Generic single week so we can add other breaks (like for Spring Break).
2) Day of the week (for the weekend, especially Sunday)
a) Weekend hours differ from weekday hours, since kids are out of school, so the hours that follow in section 3 will vary, however I need the script set up so that I can modify it for the corrected times.
3) Hour of the day (for redirection to different pages for after hours operations).
a) Between 2200 hours and 1400 hours the following day (after hours)
b) Between 1400 hours and 2200 hours (hours of operation)
This script will be the index page for the directory, and the page that is loaded will depend on the condition met above. Please just list main.php as the page that loads for each of these conditions as the redirect location, and I'll modify it as needed.
I hope you guys will understand what I'm looking for. If not, I'll happily give more details.