PHP help
-
Trying to write part of a page that would display a streaming player when we are on the air 5a-10a M-F and display something else when we aren’t on the air.
Here’s what I have right now, but it’s not working. I’m pretty new at PHP. Thanks!
<html> <head> <title>streaming</title> </head> <body> <?php //Get the current hour $current_time = date(G); //Get the current day $current_day = date(l); //On Air if ($current_day == "Saturday" or $current_day == "Sunday" or ($current_time <= 5 && $current_time >= 10)) { echo "We’re live Monday – Friday mornings. Check back then."; } // Display player else { echo "<a href="linktoplayer.html"><img src=https://www.psdgraphics.com/wp-content/uploads/2009/09/play.jpg></a>"; } ?> </body> </html>
[Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. As it stands, your code may now have been permanently damaged/corrupted by the forum’s parser.]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP help’ is closed to new replies.