Hi Guys,
i am currently putting together a php site, but i have got a little stuck and wondered whether someone could help. I have 3 HTML links when clicked on i would like to change the php content within my HTML it is held. My code is underneath, the three links i refer to would be “now showing”, “coming soon” and “arts council” they are without the link tagging below. The 4 small tables below complete the “now showing” section. When clicked on the coming soon link i would like to change the content of these tables.
Though the other sections might have to hold more than just the 4 tables. I was thinking is it possible to use the php include tag somehow? Have each section in a different page and included on page when link is clicked.
Thanks
<?php
//open data file
$fp = fopen (“films.csv”, “r”);
//this uses the fgetcsv function to store the info in the array $data
$dataA = fgetcsv ($fp, 1000, “,”);
$dataB = fgetcsv ($fp, 2000, “,”);
$dataC = fgetcsv ($fp, 3000, “,”);
$dataD = fgetcsv ($fp, 4000, “,”);
?>
<!– use $data[n] for fields –>
<table width=”300″ border=”0″ cellpadding=”3″ cellspacing=”0″>
<tr>
<td><h1>Now Showing</h1></td>
<td><h1>Coming Soon</h1></td>
<td><h1>Arts Council</h1></td>
</tr>
</table>
<table width=”460″ border=”0″ cellpadding=”3″>
<tr>
<td style=”vertical-align: top” width=”108″ rowspan=”2″><img src=”blood.jpg”></td>
<td><span id=”h1″><?php echo $dataA[1] ?></span> <span id=”h4″><?php echo $dataA[2] ?></span></td>
</tr>
<tr>
<td style=”vertical-align: top”><span id=”b1″>Showing from <b><?php echo $dataA[3] ?></b> Nightly at <b><?php echo $dataA[5] ?></b><br>
<b>Directed by:</b> <?php echo $dataA[6] ?><br>
<b>Starring:</b> <?php echo $dataA[7] ?> <b>Time:</b> <?php echo $dataA[9] ?><br>
<b>Notes:</b> <?php echo $dataA[8] ?><br>
<b>Synopsis:</b> <?php echo $dataA[10] ?></span></td>
</tr>
</table>
<table width=”460″ border=”0″ cellpadding=”3″>
<tr>
<td style=”vertical-align: top” width=”108″ rowspan=”2″><img src=”awake.jpg”></td>
<td><span id=”h1″><?php echo $dataB[1] ?></span> <span id=”h4″><?php echo $dataB[2] ?></span></td>
</tr>
<tr>
<td style=”vertical-align: top”><span id=”b1″>Showing from <b><?php echo $dataB[3] ?></b> Nightly at <b><?php echo $dataB[4] ?></b><br>
<b>Directed by:</b> <?php echo $dataB[5] ?><br>
<b>Starring:</b> <?php echo $dataB[6] ?> <b>Time:</b> <?php echo $dataB[8] ?><br>
<b>Notes:</b> <?php echo $dataB[7] ?><br>
<b>Synopsis:</b> <?php echo $dataB[9] ?><br></span></td>
</tr>
</table>
<table width=”460″ border=”0″ cellpadding=”3″>
<tr>
<td style=”vertical-align: top” width=”108″ rowspan=”2″><img src=”spiderwick.jpg”></td>
<td><span id=”h1″><?php echo $dataC[1] ?></span> <span id=”h4″><?php echo $dataC[2] ?></span></td>
</tr>
<tr>
<td style=”vertical-align: top”><span id=”b1″>Matinees until <b><?php echo $dataC[3] ?></b> Sat & Sun at <b><?php echo $dataC[4] ?></b><br>
<b>Directed by:</b> <?php echo $dataC[5] ?><br>
<b>Starring:</b> <?php echo $dataC[6] ?> <b>Time:</b> <?php echo $dataC[8] ?><br>
<b>Notes:</b> <?php echo $dataC[7] ?><br>
<b>Synopsis:</b> <?php echo $dataC[9] ?><br></span></td>
</tr>
</table>
<table width=”460″ border=”0″ cellpadding=”3″>
<tr>
<td style=”vertical-align: top” width=”108″ rowspan=”2″><img src=”horton.jpg”></td>
<td><span id=”h1″><?php echo $dataD[1] ?></span> <span id=”h4″><?php echo $dataD[2] ?></span></td>
</tr>
<tr>
<td style=”vertical-align: top”><span id=”b1″>Matinees until <b><?php echo $dataD[3] ?></b> Sat & Sun at <b><?php echo $dataD[4] ?></b><br>
<b>Directed by:</b> <?php echo $dataD[5] ?><br>
<b>Starring:</b> <?php echo $dataD[6] ?><br>
<b>Notes:</b> <?php echo $dataD[7] ?> <b>Time:</b> <?php echo $dataD[8] ?><br>
<b>Synopsis:</b> <?php echo $dataD[9] ?><br></span></td>
</tr>
</table>
<?php
//close the filehandle $fp
fclose ($fp);
?>