|
Post by fsilvestre on Nov 6, 2012 18:39:18 GMT -5
If anyone is interested in a quicker way to list your txt files for this project use this function I came up with.
<?php function listtxt($Dir) { if (is_dir($Dir)) {//create table listing echo '<table border=1> <tr> <th colspan="4">Text Files</th> </tr>'; echo '<tr>'; $DirEntries = glob($Dir . "*.txt"); foreach ($DirEntries as $Entry) { echo "<tr><td><a href=\"". $Entry."\"> ".htmlentities($Entry)."</a></td><td>"; }//end loop echo "</table>"; }//end if else { echo "<p>The directory " . htmlentities($Dir) . " does not exist.</p>"; }//end else }
?>
Just add it to your index.php in 1059 Homework tables like this: <?listtxt("hw8/");?> etc
|
|