Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.