Hey guys,
Hopefully someone out there can help me.
I've written a script that displays the contents of a directory. It also links to the file so when I click on it it displays the file contents.
What I want to do is when I click on that file it creates that a new page with a header and footer include with the contents in the middle.
So far this is the code I have:
<?php
for ($j=65; $j<=90; $j++){
echo '<div class="list">';
$a=chr($j);
if ($a != "J" && $a != "Q" && $a != "X" && $a != "Z") {
echo '<div class="large">'.$a.'</div>';
echo '<div class="small">';
if ($handle = opendir('poems/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "Q" && $file != "J" && $file != "X" && $file != "Z" && $file[0] == $a) {
echo '<div class="test">';
echo "<a href=\"poems/$file\" class='nav'>$file</a><br />";
echo '</div>';
}
}
}
echo '</div>';
closedir($handle);
}
echo '</div>';
}
?>
Any help would be amazing! Thanks!