Navigation PHP File
<?php
function showRegularFiles($path)
{
$fileList = array();
if($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if (!is_dir($file) && $file != 'index.php'
&& $file != 'navigation.php' && $file[0] != '.')
{
// echo '<a href = "'.$file.'">'."$file"."</a><br/>\n";
array_push($fileList, $file);
}
}
closedir($handle);
}
sort($fileList);
foreach($fileList as $k)
{
echo '<li><a href = "'.$k.'">'."$k"."</a></li>\n";
}
unset($k);
}
function showDirectories($path)
{
$dirList = array();
if($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if (is_dir($file) && $file != "." && $file != "..")
{
// echo '<a href = "'.$file.'">'."$file"."</a><br/>\n";
array_push($dirList, $file);
}
}
closedir($handle);
}
sort($dirList);
foreach($dirList as $k)
{
echo '<li><a href = "'.$path."/".$k.'">'."$k"."</a></li>\n";
}
unset($k);
}
?>
<h2>Navigation</h2>
<hr />
<h3>Directories</h3>
<?php
echo '<ul>';
echo '<li><a href = "..">Parent Directory</a></li>';
showDirectories(".");
echo '</ul>';
echo '<hr/>';
echo '<h3>Files</h3>';
echo '<ul>';
showRegularFiles(".");
echo '</ul>';
echo '<hr />';
echo '<h3>Other Places</h3>';
echo '<ul>';
echo '<li><a href = "index.php">Back to Index Page</a></li>';
echo '<li><a href = "/~morrison/currentClasses">Current Courses Page</a></li>';
echo '<li><a href = "/~morrison">Morrison\'s Main Page</a></li>';
echo '</ul>';
?>
Typical Index Page
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="stylesheet" href ="/~morrison/CSS/pageContent0220.css" />
<link rel="stylesheet" href ="/~morrison/CSS/boxes.css" />
<link rel="stylesheet" href ="/~morrison/CSS/gridLayout0820.css" />
<link rel="stylesheet" href ="/~morrison/CSS/menus.css" />
<link href="https://fonts.googleapis.com/css?family=EB+Garamond" rel="stylesheet">
<link rel = "shortcut icon" href = "/~morrison/CSS/rhino.ico"/>
<link rel="stylesheet" href="/~morrison/SCRIPTS/styles/sunburst.css"/>
<script src="/~morrison/SCRIPTS/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<style>
pre.prettyprint{
border: none;
margin-left:auto;
margin-right:auto;
width:80%;
}
table
{
width:80%;
}
</style>
<!--
Uncomment for mathJax
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
-->
<!--
Uncomment for JQuery
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
-->
<title>22 January 2021</title>
</head>
<body>
<header>
<h2>22 January 2021</h2>
<?php include '/home/morrison/public_html/SCRIPTS/menus.php';
?>
</header>
<nav>
<?php
include '/home/morrison/public_html/SCRIPTS/navigation.php';
?>
</nav>
<main>
<pre><code>
<?php
function showRegularFiles($path)
{
$fileList = array();
if($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if (!is_dir($file) && $file != 'index.php'
&& $file != 'navigation.php' && $file[0] != '.')
{
// echo '<a href = "'.$file.'">'."$file"."</a><br/>\n";
array_push($fileList, $file);
}
}
closedir($handle);
}
sort($fileList);
foreach($fileList as $k)
{
echo '<li><a href = "'.$k.'">'."$k"."</a></li>\n";
}
unset($k);
}
function showDirectories($path)
{
$dirList = array();
if($handle = opendir($path))
{
while (false !== ($file = readdir($handle)))
{
if (is_dir($file) && $file != "." && $file != "..")
{
// echo '<a href = "'.$file.'">'."$file"."</a><br/>\n";
array_push($dirList, $file);
}
}
closedir($handle);
}
sort($dirList);
foreach($dirList as $k)
{
echo '<li><a href = "'.$path."/".$k.'">'."$k"."</a></li>\n";
}
unset($k);
}
?>
<h2>Navigation</h2>
<hr />
<h3>Directories</h3>
<?php
echo '<ul>';
echo '<li><a href = "..">Parent Directory</a></li>';
showDirectories(".");
echo '</ul>';
echo '<hr/>';
echo '<h3>Files</h3>';
echo '<ul>';
showRegularFiles(".");
echo '</ul>';
echo '<hr />';
echo '<h3>Other Places</h3>';
echo '<ul>';
echo '<li><a href = "index.php">Back to Index Page</a></li>';
echo '<li><a href = "/~morrison/currentClasses">Current Courses Page</a></li>';
echo '<li><a href = "/~morrison">Morrison\'s Main Page</a></li>';
echo '</ul>';
?>
</code></pre>
</main>
<footer>
<ul>
<li><a href = "../21Jan21/index.php">last class</a></li>
<li><a href = "../">next class</a></li>
<li><a href = "../index.php"> Back to Calendar View</a></li>
</ul>
</footer>
</body>
</html>