554 users online (0 members and 554 guests)  

  Results 1 to 1 of 1


  1. Need help with PHP poll code    Forum: PHP Forum
    Replies: 4
  2. Help with PHP poll script    Forum: PHP Forum
    Replies: 10
  3. Replies: 2
  4. php code for poll    Forum: PHP Forum
    Replies: 4
  5. Replies: 1
  1. #1
    Elle0000's Avatar
    New User

    Join Date
    Oct 2006

    Hand Writing Poll Results Scripts

    I need to display the results of a short poll, and display the percentage of results for each option in each question.
    I don't know how to calculate the total number of results for each option or how to calculate and display the percentage of each vote.
    One of the questions asks for your favorite month. I used M1-M12 to represent the checked value for the months. Below is what I have for the results script so far.
    Thanx muchly
    PHP Code:
    <title>Your Favorites</title> 
    <style type="text/css"> 
    .style1 { 
    color: #333399; 
    font: bold 24px Arial; 
    text-align: center; 

    .style2 { 
    color: #333399; 
    font: bold 14px Arial; 

    .style5 { 
    font-size: 16px; 
    color: #330099; 
    font-family: Arial; 


    <form action="Poll.html" method="get"> 
    <p class="style1">Your Favorites !</p> 
    <p class="style5"> Thank you participating in this poll. <br> 
    If any items are incomplete, please hit the back button and complete your submission. </p> </strong> 
    if ( $Flower == "" ) { 
    "Please vote for your favorite flower."
    } else { 
    "Your favorite flower is the: $Flower."; } 
    if ( $Month == "" ) { 
    $error=true;Vote for your favorite month."; 
    } else { 
    echo "
    Your favorite month is$Month."; } 
    if ( 
    $Sport== "" ) { 
    echo "
    Please vote for your favorite sport."; 
    } else { 
    echo "
    Your favorite sport is$Sport."; } 
    Below are the results for each Month option: 
    While (
    $Month=M1) } 
    $Jantotal=sum($M1); } 
    $JanPercent of people voted for January 
    January received 
    $Jantotal votes 

    <input type="
    Submit" value="BACK" name="Submit"> 
    <p class="
    style5"> <strong>Thanks for your time.</strong> </p> 
    Last edited by HTML; 10-10-2006 at 04:26 PM.

Tags for this Thread