
如图所示,我是希望在按下投票按钮的时候,对应的内容会显示在右边投票结果上面,按第二次会在原有的基础上面累加,但是我一直做不出来,麻烦好心人帮忙解决下
以下是模板的代码:
<table width="936" height="308" border="1" align="center">
<tr>
<td width="488"><h1 align="center">投票主题阅览</h1></td>
</tr>
<volist name="st" id="vo">
<tr >
<td align="center">
<form id="form2" name="form1" method="post" action="__URL__/tp/id/{$vo.themeid}">
{$vo.themename}
<br/>
<input name="r1" type="radio" value="{$vo.vote1}" />
{$vo.vote1} <br/>
<input name="r1" type="radio" value="{$vo.vote2}" />
{$vo.vote2} <br/>
<input name="r1" type="radio" value="{$vo.vote3}" />
{$vo.vote3} <br/>
<input name="r1" type="radio" value="{$vo.vote4}" />
{$vo.vote4} <br/>
<input name="themeid" type="hidden" value="{$vo.themeid" />
<input type="submit" name="button" id="button" value="投票" />
</form></td>
</tr>
</volist>
</table>下边是控制器的代码:public function tp($id){
$r1 = $_POST['r1'];
$tp = M("theme");
if($tp->where("themeid='$id' and vote1='$r1'"))
{
$tp1['result1']+1;
$tp->save($tp1);
$this->redirect('jgindex');
}数据库在图片上有!这两天要交作业了,急!
最佳答案