I have this form:
<form id="type" action="register.php" method="post" enctype="multipart/form-data">
<fieldset id="typeC">
<p>General Conference: <input type="text" name="general" id="general" size="1" value="0"></input></p>
<p>Youth and Adult: <input type="text" name="ya" id="ya" size="1"></input></p>
<p>Brothers and Sisters: <input type="text" name="bs" id="bs" size="1"></input></p>
</fieldset>
<fieldset id="extras">
<p>CD: <input type="checkbox" name="extras[]" id="extras[]" value="cd"></input></p>
<p>Banquet: <input type="checkbox" name="extras[]" id="extras[]" value="banquet"></input></p>
</fieldset>
<fieldset id="submit">
<p><input type="submit" name="submit" value="Select"></p>
</fieldset>
</form>
I'm wanting to extract the values in the typeC fieldset. I know I can do it with name/value pairs, like:
$POST['general'];
$POST['ya'];
but I'm wanting to create something that's more flexible than that in case the organization wants to have a different number and kind of conferences and extra functions next year. How can I write a loop that will loop through all the fields (typeC as well as the extras fieldset) and put the values in an array that I can then pass to a function?
I thought it would start like this, but I haven't been able to get this to work and I also don't know what to echo out to see all the values:
for ($i = 0; $i < $_POST.length; $i++){
echo "What do I put here?";
}