if (!isset($n)) {
header("Content-Type: text/plain; charset=US-ASCII");
echo "que?\n";
exit;
}
?>
<?>?xml version="1.0" charset="iso-8859-1" ?>
Danke
if (!$norecord) { ?>
} ?>
$result = array(
vote => $v,
aimnick => $n,
ua => $HTTP_USER_AGENT,
via => $HTTP_VIA,
viafor => $HTTP_X_FORWARDED_FOR,
ip => $REMOTE_ADDR,
host => $REMOTE_HOST,
port => $REMOTE_PORT,
referrer => $HTTP_REFERRER
);
if (!$norecord) {
if (!($fd = @fopen("votes.dat", "a"))) {
echo "Sorry, your vote couldn't be recorded!
\n";
exit;
}
fputs($fd, serialize($result) . "\n");
fclose($fd);
?>
}
if (!($fd = @fopen("votes.dat", "r"))) {
echo "Sorry, the votes couldn't be tabulated!
\n";
exit;
}
$votes['y'] = $votes['n'] = $votes['f'] = 0;
while (($buf = fgets($fd))) {
$data = unserialize($buf);
$votes[$data['vote']]++;
}
fclose($fd);
switch ($v) {
case "y":
$vd = "yes";
break;
case "n":
$vd = "no";
break;
case "f":
$vd = "don't care";
break;
default:
$vd = "Some bizarre option, '$v'";
break;
}
if ($v != '') {
echo "Thanks, $n! Your “$vd” vote has been recorded.
\n";
}
$v_y = $votes['y'];
$v_n = $votes['n'];
$v_f = $votes['f'];
$tot = $v_y + $v_n + $v_f;
if (!$tot)
$tot = 1;
$p_y = ($v_y / $tot) * 100;
$p_n = ($v_n / $tot) * 100;
$p_f = ($v_f / $tot) * 100;
?>
Here's what people think so far |
Answer | Votes |
Yes: | |