I have an HTML
form that use POST
to send data to a php file. The form is created dynamically and has a number of check boxes that can change. There is a hidden piece of data sent which is the number of persons in the list - numberOfPersons.
The echo $personCount; line shows that the numberOfPersons is received but I am unsure that the format is correct because will only ever show the first checked name in the list that was posted.
Could it be that the receiving php file does not know that numberOfPersons is a number? Do I need to set the format to integer somehow? Or is there another error?
The file that receives the post looks like this:
$personCount=$_POST["numberOfPersons"];
echo $personCount;
for ($intLoop = 1; $intLoop <= $personCount; $intLoop++)
{
echo $intLoop;
echo"<br>";
}