how do I "ajaxify" my php code?

Posted by dot on Stack Overflow See other posts from Stack Overflow or by dot
Published on 2010-04-03T00:27:06Z Indexed on 2010/04/03 0:33 UTC
Read the original article Hit count: 557

Filed under:
|
|

I have divs that I want to display at specific times throughout the day. I have it working in PHP, but it requires refreshing the browser manually. I would like my script to automatically load the right div when the time is right.

Am I on the right track? Perhaps there is a jquery plugin for this sort of thing that would handle the refreshing?

Any help is greatly appreciated... Thanks!

<?php

$time = date("H\:i");

if (($time > "16:59") && ($time < "18:59")) {
    echo "<div>1</div>";
}

elseif (($time > "18:59") && ($time < "20:59")) {
    echo "<div>2</div>"; 
}

elseif (($time > "20:59") && ($time < "22:59")) {
    echo "<div>3</div>";    
}

 else {
    echo "<div id='out'><p>Outside the specified point in time.</p></div>";
}

?>

© Stack Overflow or respective owner

Related posts about php

Related posts about AJAX