Jump to content

Help to display a vote count after a deadline has passed.


swfcfan4

Recommended Posts

Hi everyone! I am new to this forum, heard if was a great forum so I thought I'd join and ask a question so here goes!

 

I am having a little problem thinking about how to display a vote count for a web poll after a deadline has passed. I have created the web form in HTML and used the POST method to retrieve the vote from the HTML web form. I have saved the voter's selection into a text file and have a warning in place if they have voted before using a session cookie. My only problem is how to display the final result of the vote in a vote count. I can give you a sample of my code:

 


session_start ();
$_SESSION["previousVisit"] = time();
if ($_SESSION["previousVisit"])
  {
    echo "NO VOTING TWICE!!!";
  }
else
  {
    $sels = $_POST['selection'];

    echo "Every vote counts, you selected";
    echo "$vote"<br />";
   }

$filePointer = fopen ("Num_of_votes.txt", "a");
if ($filePointer)
  {
    $selct = $_POST['selection'];
    $nln = "\n" ;
    $line = $selct .$nln ;
    fputs ($filePointer, $line);

  }
fclose ($filePointer);

 

Any help would be very much appreciated and I thank you in advance if you are able to help me with my problem.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.