PHP Radio Post Array
I want to use this code to achieve the test paper generation, through the loop generated a single-choice topic, and want to pass the array post to the verification page to score, but I found that cannot get the check[] array, also cannot post to the target page.
As a novice, the purpose is to realize the function, so the code is very miscellaneous--
quesid[$i] Array can be passed to the target page normally.
Really ask for advice.
The code is as follows:
Paper
Session_Start (); if (Isset ($_session[' id '))) {$admin = $_session[' id '); $query = "SELECT * from admin_info where admin_id = ' $admin '";//sel ECT Admin Information $result = mysqli_query ($dbc, $query); $rows = Mysqli_fetch_array ($result); $admin _name = $rows [' Admin_name ']; $admin _id = $rows [' admin_id ']; echo "
';} ?>//get SQL Test Information $query = "SELECT * from test_info where test_number = ' 000 '"; $result = Mysqli_query ($dbc, $query); $rows = Mysqli_fetch_array ($result); $update _name = $rows [' Update_name ']; $test _number = $rows [' Test_number ']; $test _name = $rows [' test_name ']; $class _one = $rows [' Class_one ']/100; $class _two = $rows [' Class_two ']/100; $class _three = $rows [' Class_three ']/100; $danx _quantity = $rows [' danx_quantity ']; $duox _quantity = $rows [' duox_quantity ']; $pand _quantity = $rows [' pand_quantity ']; $test _uptime = $rows [' Test_uptime ']; $test _start = $rows [' Test_start ']; $test _end = $rows [' Test_end ']; $test _duration = $rows [' test_duration ']; $test _status = $rows [' Test_status '];?
| Echo ' '. $test _name. ' '; Echo ' NOTE: 1. You have '. $test _duration ' time to answer, please hold the time; 2. The theoretical examination contains a single-choice topic: '. $danx _quantity. ', multiple-choice: '. $duox _quantity. ', Judgment question: '. $pand _quantity. '; 3. The proportion of content in each part is the basis of political theory: '. ($class _one*100). ' %, statute of ordinances: '. ($class _two*100). ' %, arms common sense and military high technology: '. ($class _three*100). ' %。 ';?> |
One, Single choice questions $danx _quantity; $class _one_num = Round (($danx _quantity* $class _one), 0); $class _two_num = Round (($danx _quantity* $class _two), 0); $class _three_num = ($danx _quantity-$class _one_num-$class _two_num); Account one for ($id = 1, $sub _id = 1, $c 1_id = 1; $sub _id '. $question _cont. '
'; Echo '; Echo ' A. '. $danx _choicea. ' '; Echo ' B. '. $danx _choiceb. ' '; Echo ' C. '. $danx _choicec. ' '; if ($danx _choiced! = NULL) {echo ' D. '. $danx _choiced. ' '; } else {echo ' '; } Echo '; Echo ' '; echo "---------------------- "; } Account two for ($sub _id, $id, $c 2_id = 1; $sub _id "$question _id"); $ques _id[$id] = $question _id; Echo ' ['. $ques _id[$id]. '; Echo '. $question _cont. '
'; Echo '; Echo ' A. '. $danx _choicea. ' '; Echo ' B. '. $danx _choiceb. ' '; Echo ' C. '. $danx _choicec. ' '; if ($danx _choiced! = NULL) {echo ' D. '. $danx _choiced. ' '; } else {echo ' '; } Echo '; Echo ' '; echo "---------------------- "; } Account three for ($sub _id, $id, $c 3_id = 1; $sub _id '. $question _cont. '
'; Echo '; Echo ' A. '. $danx _choicea. ' '; Echo ' B. '. $danx _choiceb. ' '; Echo ' C. '. $danx _choicec. ' '; if ($danx _choiced! = NULL) {echo ' D. '. $danx _choiced. ' '; } else {echo ' '; } Echo '; Echo ' '; echo "---------------------- "; } ? > |
|
for ($i = 1; $i ";}? >
Back to Superiors | Sign Out
Post target page: test_check.php
for ($i =1; $i <=100; $i + +)
{
$check [$i] = $_post[' Check ' [$i];
$ques [$i] = $_post[' Quesid ' [$i];
}
Print_r ($check);
echo "
";
Print_r ($ques);
?>