"; $j++; } include "vict_top.html"; PRINT "
"; PRINT ""; $pr=0;$npr=0; $j=0;while ($j < 5) { $query = "SELECT * FROM $userstable WHERE clas = \"$cl[$j]\""; $result = MYSQL_QUERY($query); $pic_s_v = mysql_result($result,$v[$j],"pic_s"); $pic_title[0] = mysql_result($result,$v[$j],"pic_title"); $town0 = mysql_result($result,$v[$j],"town"); IF ( $o[$j] != 777 ) { $pic_s_o = mysql_result($result,$o[$j],"pic_s"); $pic_title[1] = mysql_result($result,$o[$j],"pic_title"); $town1 = mysql_result($result,$o[$j],"town"); } ELSEIF ( $o[$j] == 777 ) { $pic_title[1]="Не знаю"; $pic_s_o="116.gif"; $town1="../img"; }; PRINT ""; IF ( $v[$j] == $o[$j] ) { $pr++; PRINT ""; } ELSEIF ( $v[$j] != $o[$j] ) { $npr++; PRINT ""; } PRINT ""; PRINT ""; $j++; }; PRINT "
 ВопросВаш ответПравильный ответВаш ответ
:-):-($pic_title[0]$pic_title[1]
   Вопросов: 5  Правильных ответов: $pr Не правильных ответов: $npr
"; PRINT '
Home. Попробуйте еще раз
'; include "vict_tail.html"; $userstable = "vict_res"; $dt=date("Y-m-d H:i:s"); $ip=getenv(REMOTE_ADDR); $ip2=getenv(HTTP_X_FORWARDED_FOR); $vop=$pr + $npr; $query = "INSERT INTO $userstable (dt,ip,ip2,level,vict,res,vop) VALUES ('$dt','$ip','$ip2','1','2','$pr','$vop')"; $result = MYSQL_QUERY($query); mysql_close(); } # if $nq == 5 ELSEIF ($nq != 5) { Srand(date("U")); if ( $nq == '' ) { $nq=0; $query = "SELECT * FROM $userstable WHERE level = '1'"; $result = MYSQL_QUERY($query); $k=MYSQL_NUMROWS($result); $k--; $i=0;while ($i < 5) { $cl[$i]=rand(0,$k); $cl[$i]=mysql_result($result,$cl[$i],"clas"); #print "cl[$i]=$cl[$i] "; $i++; }; }; #$n[0]=$v[$nq]; $o[$nq - 1]=$otv; ##### #$p=rand(0,4); $p=rand(0,3); ##### UZ ##### $query = "SELECT * FROM $userstable WHERE clas = \"$cl[$nq]\""; $result = MYSQL_QUERY($query); $k=MYSQL_NUMROWS($result); $k--; #print "k=$k clas=$cl[$nq] nq=$nq"; $n[0]=rand(0,$k); $n[1]=rand(0,$k); $n[2]=rand(0,$k); $n[3]=rand(0,$k); while($n[0] == $n[1]) { $n[1]=rand(0,$k); } while($n[1] == $n[2] || $n[0] == $n[2]) { $n[2]=rand(0,$k); } while($n[2] == $n[3] || $n[1] == $n[3] || $n[0] == $n[3]) { $n[3]=rand(0,$k); } $v[$nq]=$n[0]; #print "k=$k nq=$nq n0= $n[0] n1= $n[1] n2= $n[2] n3=$n[3] p=$p otv=$otv
"; #print "v0=$v[0] v1=$v[1] v2=$v[2] v3=$v[3] v4=$v[4]
"; #print "o0=$o[0] o1=$o[1] o2=$o[2] o3=$o[3] o4=$o[4]

"; $pic_title = mysql_result($result,$n[0],"pic_title"); $j=0;while ($j < 5) { $town[$j] = mysql_result($result,$n[$j],"town"); $pic_s[$j] = mysql_result($result,$n[$j],"pic_s"); $pic_l[$j] = mysql_result($result,$n[$j],"pic_l"); $pic_h[$j] = mysql_result($result,$n[$j],"pic_h"); $pic_w[$j] = mysql_result($result,$n[$j],"pic_w"); $j++; } include "vict_top.html"; PRINT '
'; PRINT "$pic_title
"; $nq++; PRINT "
Вопрос $nq
"; PRINT '
'; PRINT ""; $i=0;while ($i < 5) { PRINT " "; $i++; }; $i=0; PRINT ''; $i=0;$j=1; WHILE ($i < 4){ IF ( $p == $i) { $w_url="'$town[0]/$pic_l[0]'";$w_h=$pic_h[0];$w_w=$pic_w[0]; PRINT ""; } ELSEIF ( $p != $i ) { $w_url="'$town[$j]/$pic_l[$j]'";$w_h=$pic_h[$j];$w_w=$pic_w[$j]; PRINT ""; $j++; }; $i++; }; PRINT ''; $i=0;$j=1; WHILE ($i < 4){ IF ( $p == $i) { PRINT ""; } ELSEIF ( $p != $i ) { PRINT ""; $j++; }; $i++; }; PRINT '
\"Загружается \"Загружается
'; PRINT "
Не знаю
"; PRINT '
'; PRINT '
'; PRINT '
Home. Вернуться в начало
'; include "vict_tail.html"; }; ?>