Hi there,
I am trying to write a 'list of events' script.
Basically I want to list up and coming events and when those events have passed I want them hidden.
I am currently using this:
<?php
$date = date("Ymd");
$handle=opendir('events');
while (($file = readdir($handle))!==false) {
if ($file >= $date) {
include("events/$file");
}
}
closedir($handle);
?>
Very basic I know - but could you tell me how to add a line that tells the user if there are no events at present. So if all current events pass it just says 'Sorry, no events are planned at present'
The script works though calling dated txt files in YYYYMMDD format.
I hope you can help 🙂 or maybe you have a better solution.
Thanks a lot
Justin