- 主题:[Bug] Web 投票时复选类型无法限制票数
至少普通用户看来, 有复选上限的投票还是可以想投多少就投多少, 不会报错
在 bbsvote.php 的 70-75 行
--
FROM 58.19.126.*
可以修正
}else if( $votetype == "复选" ){
for($i = 0; $i < 32; $i++){
$itemstr = "ITEM".($i+1);
if(isset($_POST[$itemstr]) && $_POST[$itemstr]=="on"){
$votevalueint += ( 1 << $i );
}
}
}
可以改成
}else if( $votetype == "复选" ){
$votecount = 0
for($i = 0; $i < 32; $i++){
$itemstr = "ITEM".($i+1);
if(isset($_POST[$itemstr]) && $_POST[$itemstr]=="on"){
$votevalueint += ( 1 << $i );
$votecount += 1;
}
}
if ($votecount > $_POST['maxtkt'])
html_error_quit("超过最多选项");
}
【 在 whusnoopy@newsmth.net-SPAM.no (Snoopy) 的大作中提到: 】
: 至少普通用户看来, 有复选上限的投票还是可以想投多少就投多少, 不会报错
: 在 bbsvote.php 的 70-75 行
--
FROM 211.68.71.98
会报错啊,bbsvote.php的70行开始是这样的:
}else if( $votetype == "复选" ){
$vcount = 0;
for($i = 0; $i < 32; $i++){
$itemstr = "ITEM".($i+1);
if(isset($_POST[$itemstr]) && $_POST[$itemstr]=="on"){
$votevalueint += ( 1 << $i );
$vcount++;
}
}
if($vcount > $votearr[0]["MAXTKT"]) {
html_error_quit("您选择的票大于允许的投票数,请重新投票");
}
【 在 whusnoopy (Snoopy) 的大作中提到: 】
: 至少普通用户看来, 有复选上限的投票还是可以想投多少就投多少, 不会报错
: 在 bbsvote.php 的 70-75 行
--
FROM 166.111.18.*
er. 难道我很久没更新本地的这份了?
【 在 SoapDinosaur (肥龙) 的大作中提到: 】
: 会报错啊,bbsvote.php的70行开始是这样的:
: }else if( $votetype == "复选" ){
: $vcount = 0;
: ...................
--
FROM 58.19.126.*