I am trying to set up a list where someone can input data. The issue is that when they submit the number of items, it brings out a empty list item.
Here's the code on the prior page.
<form method="post" action="test.htm">
<?php
for ($Counter=0; $Counter<$number; $Counter++)
{
$Offset = $Counter+1;
echo "<br><br>Please input the time and information for number $Offset<br><br>";
echo "<input name=service[] type text>";
}
if ($Counter==0) echo"Press the button to move on";
?>
<br />
<br />
<input type="submit">
</form>
Here's the code with what I'm trying to do on the last page.
<ul>
<?php
$Count=0;
do
{
echo "<li>$service[$Count]</li>";
$CheckEmpty = "$service[$Count]";
$Count=$Count+1;
} while ($CheckEmpty!="");
if ($Count==1) echo "Sorry nothing here";
?>
</ul>
For some reason, I get a empty list item and don't want it to print on the page. I tried several things that I thought might work, but all they caused were bigger problems.
If someone would please give me an idea, I would appreciate it.
Thanks