September 19, 2009 09:56PM
I use the following script to read a list of events from a database and output the all the entries:
.............................
<?
$event = 0;
if(isset($_GET['event'])) $event = $_GET['event'];
@include($document . "events-data.php");
$limit = count($database);
for ( $event = 0; $event < $limit; $event += 1) {
echo "<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH=180><A HREF=" . $database[$event]['link'] . " TARGET=_blank><IMG SRC=" . $database[$event]['image'] . " BORDER=0></A></TD><TD VALIGN=TOP STYLE=PADDING-LEFT:10><B>" . $database[$event]['host'] . "<BR><SPAN STYLE=font-size:22>" . $database[$event]['name'] . "</B></SPAN><BR>" . $database[$event]['date'] . ", " . $database[$event]['location'] . "<BR><BR><P ALIGN=JUSTIFY>" . $database[$event]['abstract'] . "</P>For more information: <A HREF=" . $database[$event]['link'] . " TARGET=_blank><FONT COLOR=664400>" . $database[$event]['link'] . "</FONT></A><BR></TD></TR><TR><TD COLSPAN=2><HR SIZE=1 COLOR=c4940f></TD></TR>";
}
?>
...................................
Here's a sample of the database:
...................................
<?
$database[0] = array
(
'name' => 'Fall Jamboree',
'date' => 'September 25 - 26',
'location' => 'Verda Event Field',
'host' => 'Harlan County Ridge Runners',
'link' => 'http://www.kyoutdoors.org',
'image' => 'graphics/events/hcrrfalljamboree.png',
'abstract' => 'All Events Are FREE, a $5.00 gate fee per person, age 12 and under FREE, will cover your event fee this year for all events. Schedule of days and times are: The Fall Crawl events will be as followed: Friday evening registration begins at 4:00 PM with events starting a 6:00 PM. Friday night events will be pole bending and Sled pull. Saturday, registration begins at 3:00 PM with events starting at 5:00 PM. Saturday evening events will be obstacle course, kids obstacle course, kids drag race, adult drag race, mud bog and ladies dash for cash.'
);
$database[1] = array
(
'name' => 'Club ride and campout',
'date' => 'September 26',
'location' => 'Location to be announced',
'host' => 'Kentucky Mountain Crawlers',
'link' => 'http://www.kymc.org',
'image' => 'graphics/events/kymcelkbugling.png',
'abstract' => 'Elk bugling. Exact time and location to be announced'
);
?>
...........................
This works perfectly when I upload it to the server, but as I'm building it locally and using EasyPHP to preview it, nothing at all is output. There are no errors output.
This isn't really causing me any problems, but I'm new to PHP and am curious as to why it wouldn't work.
Thanks.