⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poll.php

📁 make project on java
💻 PHP
字号:
<?php
include'include/begin.php';

unset($row, $pauthor);
$aid = (int)$_GET["aid"];
$result = mysql_query("select * from {$db_prefix}annex where id='$aid' && fix='1'", $myconn);
if ($annexs = mysql_fetch_array($result)) {
    if ($annexs['code'] != 'poll') {
        jsechoerror(10);
    } 
    $tid = $annexs['tid'];
    $result = mysql_query("select * from {$db_prefix}title where cid='$tid' && wid>0", $myconn);
    if ($trow = mysql_fetch_array($result)) {
        $pauthor = $trow["author"];
        $wid = $trow["wid"];
        if (!isset($whype[$wid])) {
            echoerror(99);
        } 
      
        wstyle($t4[$wid]);
        include language();
    } 
    $annextype = explode('|', $annexs['type']);
    $downuser = explode(',', $annexs['downuser']);
    if (!isset($_POST["poll"]) || !$annextype[0] && !is_numeric($_POST["poll"]) || $annextype[0] && !is_array($_POST["poll"])) {
        echoerror(0);
    } 
    if ($annextype[1] && !$username) {
        echoerror(136);
    } 
    !$annextype[1] && in_array($_SERVER['REMOTE_ADDR'], $downuser) || $annextype[1] && in_array($username, $downuser)?echoerror(121): null;
    unset($polllist, $pollscontent, $value, $polls);
    $content = explode('|', $annexs['content']);
    if (is_array($_POST["poll"])) {
        while (list(, $val) = each($_POST['poll'])) {
            $value[$val] = 1;
        } 
    } else {
        $value[$_POST['poll']] = 1;
    } while (list($key, $val) = @each($content)) {
        $poll = explode("\t", $val);
        $pollscontent[$key] = $poll[0];
        $polls[$key] = $poll[1] + $value[$key];
    } 
    $pollnum = array_sum($polls);
    while (list($key, $val) = each($polls)) {
        $polllist[] = $pollscontent[$key] . "\t" . $polls[$key];
    } 
    $polllist = mysql_escape_string(implode('|', $polllist));
    $downuser[] = $annextype[1]?$username : $_SERVER['REMOTE_ADDR'];
    $downusers = implode(',', $downuser);
    ka($downuser, 65500);
    ka($polllist, 65500);
    mysql_query("update {$db_prefix}annex set downuser='$downusers', content='$polllist',downnum='$pollnum' where id='$annexs[id]'" , $myconn);
    $reurl = 'read.php?tid=' . $annexs['tid'];
    echoioy(40);
} else {
    echoerror(98);
} 

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -