I'm a little new at this, so sorry if the answer should be obvious.
Here's my problem:
I need to create an index page for a directory. The index page needs to contain the following:
a. A list of all of the files within the directory, but only the php files, and only the ones that begin with "PHOTO". For example:
PHOTO1.php
PHOTO2.php
PHOTO3.php
PHOTO4.php
PHOTO5.php
b. I also need it to display the contents of the 13th table cell within each of those pages, because that has a description of the page. Something along the lines of:
I would normally just create a table in a plain HTML page and do this manually, but the are A LOT of these "PHOTO" pages and more with probably be added. I figured that PHP my be the best way to automate the process, but I'm getting a little lost.
I'm assuming I need to build these into arrays but I'm a little lost on the approach.
This is as far as I've been able to get:
[/code]
<?php
$dir = opendir("."
?>
[/code]
After that point I just can't seem to find anything in the books I have that seems to help.
Here's my problem:
I need to create an index page for a directory. The index page needs to contain the following:
a. A list of all of the files within the directory, but only the php files, and only the ones that begin with "PHOTO". For example:
PHOTO1.php
PHOTO2.php
PHOTO3.php
PHOTO4.php
PHOTO5.php
b. I also need it to display the contents of the 13th table cell within each of those pages, because that has a description of the page. Something along the lines of:
Code:
<table>
<tr><td> $fileName[1] </td><td> $fileDescription[1] </td></tr>
<tr><td> $fileName[2] </td><td> $fileDescription[2] </td></tr>
<tr><td> $fileName[3] </td><td> $fileDescription[3] </td></tr>
<tr><td> $fileName[4] </td><td> $fileDescription[4] </td></tr>
<tr><td> $fileName[5] </td><td> $fileDescription[5] </td></tr>
<tr><td> $fileName[6] </td><td> $fileDescription[6] </td></tr>
<tr><td> $fileName[7] </td><td> $fileDescription[7] </td></tr>
</table>
I would normally just create a table in a plain HTML page and do this manually, but the are A LOT of these "PHOTO" pages and more with probably be added. I figured that PHP my be the best way to automate the process, but I'm getting a little lost.
I'm assuming I need to build these into arrays but I'm a little lost on the approach.
This is as far as I've been able to get:
[/code]
<?php
$dir = opendir("."

?>
[/code]
After that point I just can't seem to find anything in the books I have that seems to help.