--- db/prgsrc/db.cgi 2000/10/20 04:06:54 1.6 +++ db/prgsrc/db.cgi 2000/10/20 05:17:03 1.7 @@ -480,7 +480,7 @@ sub Get12Random { WHERE QuestionId=$q"); $sth->execute; $t = ($sth->fetchrow)[0]; - } until !$chosen{$q} && $t =~ /$type/; + } until !$chosen{$q} && $type =~ /[$t]/; $chosen{$q} = 'y'; push @questions, $q; } @@ -603,9 +603,11 @@ MAIN: } if (param('rand')) { - my ($type, $qnum) = ('þ', 12); - $type = 'â' if (param('brain')); + my ($type, $qnum) = ('', 12); + $type .= 'â' if (param('brain')); + $type .= 'þ' if (param('chgk')); $qnum = param('qnum') if (param('qnum') =~ /^\d+$/); + $qnum = 0 if (!$type); if (param('email') && -x $SENDMAIL && open(F, "| $SENDMAIL -t -n")) { my ($Email) = param('email');