|
$rts_information = "
";
if ($_POST["rtsvote"] != "yes") {
echo "$rts_information";
} else if ($_POST["rtsvote"] == "yes") {
$voter_ip = "$_SERVER[REMOTE_ADDR]";
$vote = "$_POST[rtssong]";
$ips = file("rtsvotes.dat");
for($index = 0; $index < count($ips); $index++)
{
if(strpos($ips[$index], $voter_ip))
{
$ips[$index] = "";
$thefile = fopen("rtsvotes.dat", "w");
for($newindex = 0; $newindex $voter_ip");
print(" You've already voted, so we've updated your vote.");
print(" | ");
}
}
$newaddition = fopen("rtsvotes.dat", "a");
if ($newaddition)
{
fputs($newaddition, "$vote" . "," . "$voter_ip" . "\n");
fclose($newaddition);
// echo "$voter_ip just voted for $vote. ";
}
echo "
Your vote has been counted. Thank you for voting. |
";
}
?>
|
Here are the current results:
$onecount = 0;
$twocount = 0;
$threecount = 0;
$fourcount = 0;
$fivecount = 0;
$sixcount = 0;
$sevencount = 0;
$eightcount = 0;
$ninecount = 0;
$tencount = 0;
$elevencount = 0;
$twelvecount = 0;
if($file = fopen("rtsvotes.dat", "r"))
{
while(!feof($file))
{
$line = fgetss($file, 255);
// echo "$line";
$linepart = explode(",", $line);
// echo "linepart[0] = " . $linepart[0] . " ";
// echo "linepart[1] = " . $linepart[1] . " ";
if ( $linepart[0] == "01" )
{ $onecount = $onecount + 1; }
if ( $linepart[0] == "02" )
{ $twocount = $twocount + 1; }
if ( $linepart[0] == "03" )
{ $threecount = $threecount + 1; }
if ( $linepart[0] == "04" )
{ $fourcount = $fourcount + 1; }
if ( $linepart[0] == "05" )
{ $fivecount = $fivecount + 1; }
if ( $linepart[0] == "06" )
{ $sixcount = $sixcount + 1; }
if ( $linepart[0] == "07" )
{ $sevencount = $sevencount + 1; }
if ( $linepart[0] == "08" )
{ $eightcount = $eightcount + 1; }
if ( $linepart[0] == "09" )
{ $ninecount = $ninecount + 1; }
if ( $linepart[0] == "10" )
{ $tencount = $tencount + 1; }
if ( $linepart[0] == "11" )
{ $elevencount = $elevencount + 1; }
if ( $linepart[0] == "12" )
{ $twelvecount = $twelvecount + 1; }
}
fclose($file);
}
/*
echo "onecount = " . $onecount . " ";
echo "twocount = " . $twocount . " ";
echo "threecount = " . $threecount . " ";
echo "fourcount = " . $fourcount . " ";
echo "fivecount = " . $fivecount . " ";
echo "sixcount = " . $sixcount . " ";
echo "sevencount = " . $sevencount . " ";
echo "eightcount = " . $eightcount . " ";
echo "ninecount = " . $ninecount . " ";
echo "tencount = " . $tencount . " ";
echo "elevencount = " . $elevencount . " ";
echo "twelvecount = " . $twelvecount . " ";
*/
?>
Can't Stop |
( echo $onecount ; ?>) |
|
Yesterday, Today, Tomorrow |
( echo $twocount ; ?>) |
|
Cruel |
( echo $threecount ; ?>) |
|
I Heard You (On The Telephone) |
( echo $fourcount ; ?>) |
|
No More |
( echo $fivecount ; ?>) |
|
Angel |
( echo $sixcount ; ?>) |
|
Quarantine |
( echo $sevencount ; ?>) |
|
Under Pressure |
( echo $eightcount ; ?>) |
|
Think Of Me |
( echo $ninecount ; ?>) |
|
Far Away |
( echo $tencount ; ?>) |
|
Failing |
( echo $elevencount ; ?>) |
|
That Was Then |
( echo $twelvecount ; ?>) |
|
|
|