Ejemplo n.º 1
0
                                    if (strlen($brief) > 200) {
                                        showmsgs('post_brief_toolong', '-1');
                                    }
                                    if ($cfg_ask_ifcheck == 'Y') {
                                        $dsql->ExecuteNoneQuery("insert into `#@__askanswer` (askid, ifanswer, tid, tid2, uid, username, anonymous, userip, brief, dateline, content, ifcheck)\r\n\t\t\tvalues('{$askid}', '1', '{$tid}', '{$tid2}', '{$uid}', '{$username}', '{$anonymous}', '{$userip}', '{$brief}', '{$timestamp}', '{$content}', '0')");
                                    } else {
                                        $dsql->ExecuteNoneQuery("insert into `#@__askanswer` (askid, ifanswer, tid, tid2, uid, username, anonymous, userip, brief, dateline, content)\r\n\t\t\tvalues('{$askid}', '1', '{$tid}', '{$tid2}', '{$uid}', '{$username}', '{$anonymous}', '{$userip}', '{$brief}', '{$timestamp}', '{$content}')");
                                    }
                                    $dsql->ExecuteNoneQuery("update `#@__ask` set replies=replies+1 where id='{$askid}' ");
                                    $cfg_ask_answerscore = intval($cfg_ask_answerscore);
                                    $dsql->ExecuteNoneQuery("update `#@__member` set scores=scores+{$cfg_ask_answerscore} where mid='{$uid}' ");
                                    //回答者先加分
                                    showmsgs('post_answer_succeed', "question.php?id={$askid}");
                                } else {
                                    if ($action == 'toend') {
                                        $dsql->ExecuteNoneQuery("update `#@__ask` set solvetime='{$timestamp}', status='1' where uid='{$uid}' and id='{$id}' ");
                                        @iheader("Expires: 0");
                                        @iheader("Cache-Control: private, post-check=0, pre-check=0, max-age=0", FALSE);
                                        @iheader("Pragma: no-cache");
                                        echo "<script language='javascript'> window.opener.location.reload(); self.close(); </script>";
                                        exit;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Ejemplo n.º 2
0
iloveu();
function iheader($icolor = "white", $title = "test")
{
    echo "<html><head><title>" . $title . "</title></head>";
    echo '<body style="background-color:' . $icolor . '">';
}
function aifooter()
{
    echo '<hr>Thank you</hr><br>';
    echo '</body>';
    echo '</html>';
}
$user = "******";
define(ICOLOR, "gray");
define(TITLE, "HACKED");
iheader(ICOLOR, TITLE);
echo "Welcome Mr.{$user} to website.";
aifooter();
//scope
$a = 50;
$b = 10;
$c = 30;
function test1()
{
    global $a, $b, $c;
    echo "{$a} , {$b} , {$c}" . "<br>";
}
function test2()
{
    static $xxx = 5;
    echo $xxx . "<br>";