This code was inherited from a previous version of our site http://iowacrisischat.org. It's supposed to show one button if it's between 12pm-2am central time, and another button if it's outside of those hours.
It's working on and off in Chrome, and displaying not only the wrong button but an OLD version of the button in IE and Firefox. I've tried deleting my cookies but it still displays an old version of the button that isn't even in the most recent file uploaded to the site.
So I guess a couple questions. 1) Is the time part of the code what's making Chrome inconsistent? Should it be 0-23 instead of 12 hours, does it need to have minutes? 2) Why would IE and Firefox be showing an old version of the code.
Thank you for any help!!
function crisischat()
{
date_default_timezone_set("America/Chicago");
$hour = date('G', time());
$duringHours = ($hour >= 12 || $hour < 2);
$isProblem = FALSE;
if ($duringHours) {
echo '<div id="chatbtn"><a href="https://m2.icarol.com/ConsumerRegistration.aspx?org=2133&amp;pid=51&amp;cc=en-US">.Chat Now.</a></div>';
} else if ($isProblem) {
echo 'We are experiencing technical difficulties. Please call our crisis line at 1-855-325-4296.';
} else {
echo '<div id="chatbtn"><a href="https://m2.icarol.com/ConsumerRegistration.aspx?org=2133&amp;pid=51&amp;cc=en-US">-Chat Now-</a>';
}
}
crisischat();