【发布时间】:2014-01-24 10:49:51
【问题描述】:
我是新手。我正在研究 Web 开发,并且必须为问卷创建一个 php 响应表单,然后将其输入到数据库中。我在使用单选按钮时遇到问题。我无法创建正确的代码来创建一个数组并在响应表单/页面中显示答案。
这是我的代码:
<form name="modulequestionnaire" method="post" action="tania.responseform.php" />
<p><i>Rate each question from 6 to 1, six being strongly
agree and one being strongly disagree.</i></p>
1. I think the module guide/student handbook provided enough information about the
module content, organisation and assessment.<br/>
6<input type="radio" name="answer[1]" value="6"> 5<input type="radio" name="answer[1]" value="5">
4<input type="radio" name="answer[1]" value="4"> 3<input type="radio" name="answer[1]" value="3">
2<input type="radio" name="answer[1]" value="2"> 1<input type="radio" name="answer[1]" value="1">
</p>
2.The module was well organised.<br/>
6<input type="radio" name="answer[2]" value="6"> 5<input type="radio" name="answer[2]" value="5">
4<input type="radio" name="answer[2]" value="4"> 3<input type="radio" name="answer[2]" value="3">
2<input type="radio" name="answer[2]" value="2"> 1<input type="radio" name="answer[2]" value="1">
</p>
3.The Learning Resource Centre provided adequate materials for the module.<br/>
6<input type="radio" name="answer[3]" value="6"> 5<input type="radio" name="answer[3]" value="5">
4<input type="radio" name="answer[3]" value="4"> 3<input type="radio" name="answer[3]" value="3">
2<input type="radio" name="answer[3]" value="2"> 1<input type="radio" name="answer[3]" value="1">
</p>
我知道答案可能与 isset 函数有关,但我不知道如何编写代码。 有人可以在这里教我或帮助我吗?
【问题讨论】:
-
你能发布你现有的 PHP 尝试吗?
-
@HC_ 我想为上述问题创建答案。
-
@sjagr 类似这样,但它不起作用。:";休息;案例2:打印“5
”;休息;案例3:打印“4
”;休息;案例4;打印“3
”;休息;案例5;打印“2
”;休息;案例6;打印“1
”;休息;}; ?> -
请在您的问题中而不是在评论中发布您的尝试。人们也更容易阅读。 @taniakeira
-
@Fred-ii- 好的,对不起,我是新手。
标签: php html arrays forms radio-button