I'm taking a break from Project Euler to learn some PHP/HTML for kicks and giggles, and I found a page of simple exercises. So, on my 'site,' I want to have an ordered list of links to pages of each of the exercises, but I decided to do it in a dynamic manner as opposed to hard coding each item as I do the exercise. Unfortunately, the page that should contain the list doesn't render at all!
Assuming I have files on my system with the names "exawk#.php," what else could be wrong with this code? Sorry if it is sloppy or horrible, it's literally my first day of web programming.
<html>
<head>
<title> Awaken's Exercises </title>
</head>
<body>
<h1>This page contains "Awaken's Exercises" from
<a href="http://forums.digitalpoint.com/showthread.php?t=642480">
this page</a>.</h1>
<ol>
<?php
$arex = glob("exawk*.php"); // $arex contains
//an array of matching files
$numex = 0;
$i = 0;
foreach( $arex )
{
$numex++;
}
while( $numex >= 0 )
{
echo "<li><a href=" .$arex[$i].
">Problem #" .$numex. ".</a></li>";
$numex--;
$i++;
}
?>
</ol>
</body>
</html>