I basically started over and got my ideas as to what needed to be done in order. For the most part I got it done.
index.php == page.php
<html>
<body>
<form action="index.php" method="post">
<table border="1" cellspacing="4">
<?php
include("Utility.php");
displayTable(2,2);
if(isset($_POST['submit']))
{
foreach($_POST['tbl_cell'] as $cell)
{
echo "Processing...<br />";
echo "Cell contains ".$cell."<br />";
}
}
else
echo "<h> Enter data into the cells below. </h>";
?>
</table>
<input type='submit' name='submit' value='Process'/>
</form>
</body>
</html>
Utility.php == DisplayClass.php
<?php
$tbl_cell = array();
function displayTable($rows, $cols)
{
for($c = 0; $c < $cols; $c++)
{
echo '<tr>';
for($r = 0; $r < $rows; $r++)
{
$id = (($rows * $c) + $r);
echo "<td> <input type='text' id='cell".$id."' name='tbl_cell[".$id."]'/> </td> ";
} //ends rows loop
echo '</tr>';
} //ends columns loop
} //ends function display
function displayResults()
{
echo "<h> Entered displayResults </h>";
if(empty($tbl_cell))
{
echo "<p> No data found! </p>";
} //ends if
else
{
foreach($tbl_cell as $cell)
{
echo "Processing...<br/>";
echo "<p>Cell contains ".$cell."</p><br />";
}
} //ends else
} //ends displayResults()
?>
My only remaining issue is that tbl_cell appears to be empty. I can only see results when I use the $_POST array, which makes sense given post data isn't being sent to my utility file. This could be solved in javascript since page redirects are a simple thing in that language. But php not so much. I'll run this though by the person who wants this code and see if that's something they want to do.