php-PHP POST表單失敗,目標頁無法接收

來源:互聯網
上載者:User
關鍵字 php 單選 post 數組
php單選post數組

我想通過這個代碼實現試卷試題的產生,通過迴圈產生了單選題目,並想通過數組POST給驗證頁面進行評分,但是我發現無法擷取check[]數組,也無法POST到目標頁面。
作為新手,目的是想實現功能,因此代碼很冗雜- -
quesid[$i]數組可以正常傳遞給目標頁面。
真心求教。
代碼如下:



試卷


session_start(); if(isset($_SESSION['id'])){ $admin = $_SESSION['id']; $query = "select * from admin_info where admin_id = '$admin'"; //select admin information $result = mysqli_query($dbc,$query); $rows = mysqli_fetch_array($result); $admin_name = $rows['admin_name']; $admin_id = $rows['admin_id']; echo "

"; echo ''.$admin_name.'('.$admin_id.')您好!
'; } ?> //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 '注意:
      1.你有'.$test_duration.'的時間答題,請把握好時間;
      2.理論考試包含有單選題:'.$danx_quantity.'題、多選題:'.$duox_quantity.'題、判斷題:'.$pand_quantity.'題;
      3.各部分內容所佔比例為,政治理論基礎:'.($class_one*100).'%、 條令條例:'.($class_two*100).'%、軍兵種常識與軍事高技術:'.($class_three*100).'%。
'; ?>

一、單項選擇題

$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); //科目一 for($id = 1,$sub_id = 1,$c1_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($sub_id,$id,$c2_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 "----------------------
"; } //科目三 for($sub_id,$id,$c3_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 "; } ?>



返回上級| 退出登入


POST目標頁面: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);
?>

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.