我想在其他php文件中获取表单的值,但我只获得一个输入值,因为名称在循环中相同....如何获取具有相同名称的所有输入值或者如果我必须更改这个名字告诉我怎么样?以及如何在其他php文件中获取它
<?php
if(isset($_POST['submit'])){
//getting values of number of MCQ questions and true/false questions
$mcq = $_POST['mcq'];
$truefalse = $_POST['truefalse'];
$number = 1;
echo '<form action="finalquestions.php" method="post">';
//loop to get inputs of mcq as many as the user posted
for($i=1;$i<=$mcq;$i++){
echo 'Question:'.$number.'<input type="text" name="question1" /> </br></br>';
echo '<input type="radio" name="radio1"> <input type="text" name="radiooptions" /> </br>
<input type="radio" name="radio1"> <input type="text" name="radiooptions" /> </br>
<input type="radio" name="radio1"> <input type="text" name="radiooptions" /> </br>
<input type="radio" name="radio1"> <input type="text" name="radiooptions" /> </br>';
echo '</br></br>';
$number++;
}
//loop to get inputs of truefalse as many as the user posted
for($i=1;$i<=$truefalse;$i++){
echo 'Question:'.$number.' <input type="text" name="question2" /> </br></br>';
echo '<input type="radio" name="question2">True</br>
<input type="radio" name="question1">False</br>';
echo '</br></br>';
$number++;
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>WebQuiz Generator</title>
</head>
<body>
<input type="submit" name="submit" value="Generate Quiz" />
</form>
</body>
</html>