Our site offers streaming audio on Thursday evening (7:30 to 8:30) and on Sunday morning (8:30 to 1:30p). How can I use PHP to direct the visitor to the audio streaming link only during these times. At all other times, I want a message that indicates when the streaming is available.
Thanks in advance for your suggestions!
Desi:)
Evlich
03-13-2003, 07:29 PM
You might try something like this:
<?php
$day = date("D"); //returns "Mon" "Tue"
$time = date("Hi"); //returns HoursMinutes
if( ($day == "Thu" && $time >= "1930" && $time < "2030") ||
($day == "Sun" && $time >= "0830" && $time < "1330") )
{
header("Location: REDIRECT URL");
exit;
}
?>
That should work, I am not absolutely positive about whether $day will be "Thu" or "Thr" on Thursday, but that should be correct. Hope that this helps.
~evlich
thanks for your help!
Desi