- <?php
- function performRedirection($time, $day) {
- // Function to check if the current time is between 10:00 AM and 5:30 PM
- function isTimeBetween($time) {
- return ($current_time >= $start_time && $current_time <= $end_time);
- }
- // Set common headers for all cases
- // Check the day of the week and time
- switch ($day) {
- case 'Saturday':
- case 'Sunday':
- // Redirect the user to a different URL with a temporary (302) redirect and HTTPS
- exit;
- break;
- default:
- if (isTimeBetween($time)) {
- // Redirect the user to the first URL with a temporary (302) redirect and HTTPS
- exit;
- } else {
- // Redirect the user to the second URL with a temporary (302) redirect and HTTPS
- exit;
- }
- break;
- }
- }
- performRedirection($current_time, $day_of_week);
- ?>