我想提交多个自动生成的表单,然后获取值

时间:2016-06-25 09:42:01

标签: php

include '../condbs.php';

mysql_query("SET NAMES 'utf8'");
mysql_query('SET CHARACTER SET utf8');
$mysql=mysql_query("SELECT * FROM boq_ WHERE level = '$lev' and class = '$cls' and subject = '$sbj' order by RAND() limit 0,10;");

$count=0;
while($row = mysql_fetch_array($mysql)){
    echo'<form action="" method="post">';
    echo"<label class='qlbl'>".$row['ques']."</label>"; 

    $input = array($row['rans'], $row['fans1'], $row['fans2'], $row['fans3']);
    $rand_keys = array_rand($input, 4);

    echo'<table style="width:100%;"><tr>';
    echo"<td style='width:50%;'><input onClick='this.form.submit();' type='radio' name='answer' value=".$input[$rand_keys[0]].">". $input[$rand_keys[0]]."</td>";
    echo"<td style='width:50%;'><input onClick='this.form.submit();' type='radio' name='answer' value=". $input[$rand_keys[1]] .">". $input[$rand_keys[1]] . "</td>";
    echo"</tr><tr>";
    echo"<td style='width:50%;'><input onClick='this.form.submit();' type='radio' name='answer' value=". $input[$rand_keys[2]].">". $input[$rand_keys[2]] . "</td>";
    echo"<td style='width:50%;'><input onClick='this.form.submit();' type='radio' name='answer' value=". $input[$rand_keys[3]].">". $input[$rand_keys[3]] . "</td>";
    echo"</tr></table>";
    echo'</form>';
}

我想在其他页面上获取所有这些值,但是在同一页面中的所有上述提交,如何?

0 个答案:

没有答案