christophorus
Technical User
I am trying to collect the values from multiple checkboxes into a string. If the user selects lets say 3 of the choices, how do i format them into a string like "AK,CA,CO,". Do I need to create an array first?
<form name="states" method="POST" action="<? $_SERVER['PHP_SELF']; ?>">
<input type="checkbox" name="state1" value="Nationwide">
Nationwide</p>
<input type="checkbox" name="state2" value="AK,">
AK
<input type="checkbox" name="state3" value="AL,">
AL
<input type="checkbox" name="state4" value="AR,">
AR
<input type="checkbox" name="state5" value="AZ,">
AZ
<input type="checkbox" name="state6" value="CA,">
CA
<input type="checkbox" name="state7" value="CO,">
CO
<input type="checkbox" name="state8" value="CT,">
CT
<input type="submit" name="Submit" value="Get Data">
</form>
<form name="states" method="POST" action="<? $_SERVER['PHP_SELF']; ?>">
<input type="checkbox" name="state1" value="Nationwide">
Nationwide</p>
<input type="checkbox" name="state2" value="AK,">
AK
<input type="checkbox" name="state3" value="AL,">
AL
<input type="checkbox" name="state4" value="AR,">
AR
<input type="checkbox" name="state5" value="AZ,">
AZ
<input type="checkbox" name="state6" value="CA,">
CA
<input type="checkbox" name="state7" value="CO,">
CO
<input type="checkbox" name="state8" value="CT,">
CT
<input type="submit" name="Submit" value="Get Data">
</form>