http://www.thefoldmusic.com/shows.php
At that link, you'll see I have a fully functional PHP script happily displaying tour dates from today and forward which have been entered into a folder on my server called "fold/"
Now, I'd also like to have a page that displays only PAST events. But when I do what would seem obvious, I get all kinds of strange errors. Can someone help me change the script below to successfully display all PAST events?
Thanks in advance for any help you can offer!
<?php
$date = date("Ymd");
$dir = "fold";
$handle=opendir($dir);
while (($file = readdir($handle))!==false) {
$d = substr($file,0,8);
if ($d >= $date) {
$events[$d] = file_get_contents($dir."/".$file);
}
}
closedir($handle);
ksort($events);
foreach ($events as $event) {
list($date,$location,$info) = explode("||",$event);
print
"<tr><td>".$date."</td><td>".$location."</td><td>".$info."</td></tr>";
unset($events);
}
?>