Hi guys, i have a online radio station website. I am looking to re-direct my page ONLY when there is no DJ live... and to go to my page when someone is. Does anyone know the best way of doing this?? Thanks all
you need to have a reference variable to check with your php and then process the direct to the proper or redirected page based on if its on or off
Create a semaphore either in a file or a database table. if (! isDjLive()) { // If the DJ is offline... header("Location: http://somedomain.com/redirectpage.php'); } // ... Continue loading main page function isDjLive() { $dj_is_live = false; /* Code to detect if DJ is online goes here... Either a file or a database record ... */ return $dj_is_live; } Code (markup):
this will most likely have to be built into your system using some sort of api that would exist in your radio station software
okay... just wish there was a way the whmsonic or the stream it self could tell the site its 'online/offline' status and be able to work on it from there
Ask the people at whmsonic if there is anyway of doing this... i.e. DJ mode or Autostream mode? But I assume you'll probably have to make a DJ "clock in" admin page for the check in.
i think i may have to just make a app that when i click on air it stays with my page... but when its off air redirects... god know how im gonna do this but we shall see
would anyone know how to write a ftp batch file so when i click a button for on air, it uploads my normal page. then when i click off air, it uploads the redirect page?