Hi, this is my first post as I just joined your site. I have an internet radio station. I have 4 recorded shows that I run on a weekly basis. I am trying to get the name of the show to show up on my now playing page. Some shows run 1 hour and i have 1 that runs 2 hours and one that runs 3 hours. I am trying to get a code working that will accomplish this task. I have been working on the following code and it will not work. I am VERY new to php coding and was wondering if someone could look at the script and tell me why/ and what I need to change to get this to work for me. Thanks in advance!
<?php $date= (now) ("l, h:ia"); If($date == "Monday, 10:00a" || $date == "Wednesday, 10:00a" || $date == "Saturday, 08:00a") { // Takin Ya Back With Kurt David (TYB 60S) echo "Takin Ya Back With Kurt David (TYB 60S)"; } If($date == "Monday, 2:00p" || $date == "Wednesday, 2:00p" || $date == "Saturday, 10:00a") { // Takin Ya Back With Kurt David (TYB 70s) echo "Takin Ya Back With Kurt David (TYB 70s)"; } If($date == "Monday, 6:00p" || $date == "Wednesday, 6:00p" || $date == "Saturday, 2:00p") { // Takin Ya Back With Kurt David (TYB 80s) echo "Takin Ya Back With Kurt David (TYB 80s)"; } If($date == "Friday, 8:00p") { // The Doo Wop Express With Ron Norwood echo "The Doo Wop Express With Ron Norwood"; } If($date == "Saturday, 7:00p") { // Greatest Hits U.S.A With Rick Williams echo "Greatest Hits U.S.A With Rick Williams"; } If($date == "Sunday, 2:00p") { // Saving The 70s With Mike Walker echo "Saving The 70s With Mike Walker"; } ?>Hey and welcome!
Just a quick tip, when you get errors make sure you post them. If you don’t see an error just a blank screen or a 500 Internal Server Error, check your PHP error log.
As for your problem… You weren’t setting the date correctly.
Change:
[PHP]
$date = (now) (“l, h:ia”);
[/PHP]
For:
[PHP]
$date = date(“l, h:ia”);
[/PHP]
Changed it and it didn’t work, gonna keep working on it. Thanks!
Changed it and it didn’t work, gonna keep trying thanks!
Weird, it worked for me! Did it output an error? Any other info on what it is doing?