コード例 #1
0
        $db->query("INSERT INTO pw_dyn_glenrothes_use (ltime, vrand, vpostcode, vconstituency, referrer, ipnumber, vdash)\n                    VALUES (NOW(), {$vrand}, '', '', '{$referrer}', '{$ipnumber}', '{$vdash}')");
    }
} else {
    $vrand = (int) $vrand;
    if (!isrobot() and preg_match("/.*?house=z/", $referrer)) {
        header("Content-Type: text/html; charset=UTF-8");
        print "<h1>hit counters</h1>\n";
        WriteHitCounters($db);
        exit(0);
    }
}
// no matching MP found
if (!$mpval) {
    header("Content-Type: text/html; charset=UTF-8");
    print $hithere;
    WriteFrontPage($vpostcode, $vrand);
    exit(0);
}
$mpprop = $mpval["mpprop"];
$vconstituency = $mpprop["constituency"];
if (!$printview) {
    // we're doing the page.  now post in the postcode that we now have
    $db->query("SELECT ltime, referrer, vdash FROM pw_dyn_glenrothes_use WHERE vrand = {$vrand}");
    $row = $db->fetch_row();
    if ($row) {
        $ltime = $row[0];
        $referrer = $row[1];
        $vdash = $row[2];
        $db->query("DELETE FROM pw_dyn_glenrothes_use WHERE vrand = {$vrand}");
        $db->query("INSERT INTO pw_dyn_glenrothes_use (ltime, vrand, vpostcode, vconstituency, referrer, ipnumber, vdash)\n                    VALUES ('{$ltime}', {$vrand}, '{$vpostcode}', '{$vconstituency}', '{$referrer}', '{$ipnumber}', '{$vdash}')");
    }
コード例 #2
0
            print "<tr><td>{$vpostcode}</td><td>{$min}</td><td>{$vmax}</td><td>{$vcount}</td><td>{$vevent}</td></tr>\n";
        }
        print "</table>\n";
        exit(0);
    }
    // case of just a img src sent out
    header("Content-Type: text/html; charset=UTF-8");
    exit(0);
}
header("Content-Type: text/html; charset=UTF-8");
if (is_postcode($_GET["mppc"]) or $_GET["mpc"]) {
    $vpostcode = $_GET["mppc"];
    $mpval = get_mpid_attr_decode($db, $db2, "");
}
if (!$mpval) {
    WriteFrontPage();
    exit(0);
}
$mpprop = $mpval["mpprop"];
$vconstituency = $mpprop["constituency"];
$vprintview = $_GET["print"];
print "<html>\n";
print "<head>\n";
print "<title>The Public Whip - How They Voted 2008</title>\n";
print "<link href=\"quiz/election2008.css\" type=\"text/css\" rel=\"stylesheet\"/>\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n";
print "</head>\n";
if ($vprintview) {
    print "<body onload=\"NotifyEvent('printview')\">\n";
} else {
    print "<body onload=\"UpdateCItable('onload')\">\n";