0

嘿伙计们,我正在尝试做一个测验,目前我遇到了一个问题,我已经增加了它但没有发送数据,所以我需要修复它但不知道如何修复它,我需要用户能够要选择一个选项,数据会被发送到下一页,但页面也必须递增。这就是我所拥有的

<form name="form2" method="post" >
<select name="answer">
<option value=$myrow['A']><?php echo $myrow['A']?></option>
<option value=$myrow['B']><?php echo $myrow['B']?></option>
<option value=$myrow['C']><?php echo $myrow['C']?></option>
<option value=$myrow['D']><?php echo $myrow['D']?></option>

 <input type="submit" name="submit" value="Continue" onclick = "window.location.href = 'testttts.php?id=<?php echo $count?>'"

任何帮助都会非常感谢您!

4

1 回答 1

1

你是这个意思吗?

<?php

if(isset($_POST['i'])) {
    $i = $_POST['i'];
} else {
    $i = 0;
}

echo "increment: " . $i;
$i++;
?>

<form name="form2" method="post" >
<select name="answer">
<option value=$myrow['A']><?php echo $myrow['A']?></option>
<option value=$myrow['B']><?php echo $myrow['B']?></option>
<option value=$myrow['C']><?php echo $myrow['C']?></option>
<option value=$myrow['D']><?php echo $myrow['D']?></option>
</select>
<input type="hidden" name="i" value="<?php echo $i; ?>" />

<input type="submit" name="submit" value="Continue" />
于 2013-10-15T02:33:32.390 回答