Hello Daniweb members.
Im looking to create a script which checks the current date and time (of web server to ensure a pre-set time zone) and display a message.
*What i'm aiming for the script/s to do.
*Check current date and time
*If day = eventDay BUT time = before start time
+Display count down clock
*If day = eventDay and time = after start time AND before event end time
+Display in progress
*If day = eventDay and time = after end time
+Display event ended
For example I currently have...
<?php
$dd = date('d/', time());
$mm = date('m/', time());
$yyyy = date('Y/', time());
$h = date('h:', time());
$m = date('i:', time());
$s = date('s', time());
$ampm = date('A', time());
echo "<br />";
echo $dd;
echo $mm;
echo $yyyy;
echo "<br />";
echo "<br />";
echo $h;
echo $m;
echo $s;
echo $ampm;
echo "<br />";
echo "<br />";
// EVENT STATUS //
if ($dd == 20 AND $h >= 4 AND $m >= 30)
{
if ($dd == 20 AND $h > 6 AND $m > 30)
{
Echo "This event finished at 6:30PM (GMT)";
}
else
{
include "eventClock/eventClock.php";
}
}
else
{
echo "Event Coming Soon!";
}
// END EVENT STATUS //
I know this is a very basic script which kinda works in it's own way, but has many validation errors, So I manily asking for help and improvements. Would JavaSript be better as this needs to be constintly updated.
I've looked into cron jobs, but haven't found any that can replace a file on day @ time.
Thanks,
~KingGold171
NOTE , I will be editing this post to add more detail and information.