In the seccond loop, where you output the radio button, you can use the question ID as name attribute, as in
PHP Code:
echo '<input type="radio" name="' . $qid . '" value="' . $aid . '">';
Then you would end up with an array where the question IDs are keys and the selected awnser are value, as in
PHP Code:
$_POST = array( 'qid_1' => 'aid_1', 'qid_2' => 'aid_2', 'qid_3' => 'aid_3', ... );
__________________
49206368616e676564206d79207369676e61747572652e2049 2062657420796f75206469646e5c2774206e6f7469636521
|