File size: 1.28Kb
<?php
// ГолоСувание
// Версия 0.1
// Gemorroj
// Номера кошельков. Надеюсь понятно для чего =)
// WMR 167963845445
// WMZ 225757696726
require 'config.php';
if(substr_count($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
{header('Content-type: text/html; charset=utf-8');}
else
{header('Content-type: application/xhtml+xml; charset=utf-8');}
header('Cache-control: no-cache');
print $top;
if($_POST)
{
$v = array_keys($_POST);
$v = intval($v[0]);
$i = intval($_POST[$v]);
$a = file('vote_'.$v.'.dat');
if(!$a)
{
for($t=0; $t<sizeof($answer[$v]); ++$t)
{$a[$t] = "0\n";}//именно string!
}
$a[$i] += 1;
$a[$i] .= "\n";
if(file_put_contents('vote_'.$v.'.dat',$a))
{exit('<div class="red">RED<br/></div>'.$foot);}
else
{exit('<div class="red">GEOPAK<br/></div>'.$foot);}
}
for($i=0; $i<sizeof($vote); ++$i)
{
$v = file('vote_'.$i.'.dat');
print '<fieldset>
<legend>'.$vote[$i].' ('.array_sum($v).')</legend>
<form action="?" method ="post">
<div>';
for($a=0; $a<sizeof($answer[$i]); ++$a)
{print '<input type="radio" name="'.$i.'" value="'.$a.'"/>'.$answer[$i][$a].' ('.intval($v[$a]).')<br/>';}
print '<br/><input type="submit" value="VOTE"/>
</div>
</form>
</fieldset>';
}
print $foot;
?>