I am trying to figure out how does the if else statement on php display the result without reloading the page! Is this posible or not? or anything code needed to make this work on my project? This is for my school project presentaion which the time is setted to 7:30:00 Am ! If time is equal to current time. It will display the result withour reloading the page!
This is my code but I dont have a refresh page becuase ajax didnt work!
<?php
$timenow=time();
$thetime = date('g:i:s a',$timenow);
$settime = strtotime('today 7:30:00pm');
$timesetting = date('g:i:s a',$settime);
if($timesetting <= $thetime)
{
echo "School Time";
}
else
{
echo "Not late for school";
}
?>
Aucun commentaire:
Enregistrer un commentaire