php post 失败,php-PHP POST表单失败,目标页无法接收

我想通过这个代码实现试卷试题的生成,通过循环生成了单选题目,并想通过数组POST给验证页面进行评分,但是我发现无法获取check[]数组,也无法POST到目标页面。

作为新手,目的是想实现功能,因此代码很冗杂- -

quesid[$i]数组可以正常传递给目标页面。

真心求教。

代码如下:

试卷

require ("../css/css.php");?>

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 '注意:

&nbsp &nbsp &nbsp 1.你有'.$test_duration.'的时间答题,请把握好时间;

&nbsp &nbsp &nbsp 2.理论考试包含有单选题:'.$danx_quantity.'题、多选题:'.$duox_quantity.'题、判断题:'.$pand_quantity.'题;

&nbsp &nbsp &nbsp 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 &nbsp'.$question_cont.'

'; echo ''; echo '&nbsp &nbsp A.'.$danx_choiceA.'

'; echo '&nbsp &nbsp B.'.$danx_choiceB.'

'; echo '&nbsp &nbsp C.'.$danx_choiceC.'

'; if($danx_choiceD != NULL){ echo '&nbsp &nbsp 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 '&nbsp'.$question_cont.'

'; echo ''; echo '&nbsp &nbsp A.'.$danx_choiceA.'

'; echo '&nbsp &nbsp B.'.$danx_choiceB.'

'; echo '&nbsp &nbsp C.'.$danx_choiceC.'

'; if($danx_choiceD != NULL){ echo '&nbsp &nbsp D.'.$danx_choiceD.'

'; } else { echo '

'; } echo ''; echo '

'; echo "----------------------

"; } //科目三 for($sub_id,$id,$c3_id = 1;$sub_id &nbsp'.$question_cont.'

'; echo ''; echo '&nbsp &nbsp A.'.$danx_choiceA.'

'; echo '&nbsp &nbsp B.'.$danx_choiceB.'

'; echo '&nbsp &nbsp C.'.$danx_choiceC.'

'; if($danx_choiceD != NULL){ echo '&nbsp &nbsp 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);

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值