Showing posts with label poll. Show all posts
Showing posts with label poll. Show all posts

Thursday, June 23, 2016

DRBPoll PHP Poll Script

DRBPoll is a free and simple PHP poll script that doesnt require a database. It allows you to put a poll form on virtually any page on your web site. The results page displays a colored bar graph of the votes. The look-and-feel of the poll form and results page can be customized using a standard CSS file. Data is stored in flat files, therefore no database is required.

Features

  • Quick and easy to install.
  • The poll data is stored in flat files, so no database is required.
  • Prevents the same IP address from voting on a poll more than once.
  • XHTML syntax compliant, and compatible with both IE and Firefox.
  • Colors and fonts are defined in an ordinary, customizable CSS file.
  • The script is highly configurable and customizable.
  • Multiple polls on the your site can utilize the same instance of the script.
  • Poll options can be rendered as either radio buttons or a combobox.
  • Includes an example page demonstrating how to add a poll to virtually any PHP page on your website.

 Download PHP Poll Script

Saturday, June 18, 2016

Creating a simple poll

We are going to create a simple poll that users may select what programming laguage they prefer (ASP or PHP)

First of all prepare four files as below:

1. asp.txt and then insert the number 0 in it as initial value. 
2. php.txt and then type the number 0 in it as initial value. 
Note:  Do not forget to insert the value 0 in the asp.txt and php.txt. This is very important so that the script works
3. create an image file poll.jpg with size 100x10px. This is to make the percentage of polling. 
This is also important to make our poll eye-catching. 
4. index.php and type in it the script below 

<title> Simple Polling </ title>
<style type="text/css">
<! --
. style1 (font-size: 24px)
. style2 (color: # 0000FF)
->
</style>
<form name="form1" method="post" action="index.php?content=polling">
<p>
Polling <label> <span class="style1"> </span> </label>
</p>
<p>
<label> Which web programming language do you prefer? </label>
</p>
<p>
<label>
<input type="radio" name="vote" value="php">
PHP </label>
<br>
<label>
<input type="radio" name="vote" value="asp">
ASP </label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Submit">
</label>
<br>
</p>
</form>
<?php
if (@$_GET[content])
{
$vote = $_POST[vote];
if ($vote == "") // if no choice yet
{
echo "You have not <font color=red> fill surveys </font>";
exit;
}
if ($vote == "php") // add 1 for  php
{
$open = fopen("php.txt", "r");
$read = fgets($open, 65535);
fclose ($open);
$open = fopen("php.txt", "w");
$read++;
fwrite ($open, $read);
fclose ($open);
}
if ($vote == "asp") // add 1 for asp
{
$open = fopen ("asp.txt", "r");
$read = fgets ($open, 65535);
fclose($open);
$open = fopen("asp.txt", "w");
$read++;
fwrite($open, $read);
fclose($open);
}
$open_php = fopen("php.txt", "r");
$readphp = fgets($open_php, 65535); // read the value for php
fclose($open_php);
$open_asp = fopen ("asp.txt", "r");
$readasp = fgets($open_asp, 65535); // read the value for asp
fclose($open_asp);
$total_user = $readphp + $readasp; // the number of voters
$persentase_php = ($readphp / $total_user) * 100;
$persentase_asp = ($readasp / $total_user * 100);
echo "Total voters: $total_user <br>";
echo "PHP:"; printf("% 1.0f", "$persentase_php"); echo "% <img src=poll.jpg width =$persentase_php  $height = 10 /> $readphp voters <br> ";
echo "ASP"; printf("% 1.0f", "$persentase_asp"); echo "% <img src = poll.jpg width =$persentase_asp  $height = 10 /> $readasp voters <br> ";
}
?>

Friday, June 3, 2016

Free Poll Script In PHP

DRBPoll is a simple PHP poll script that doesnt require a database. It allows you to put a poll form on virtually any page on your web site. The results page displays a colored bar graph of the votes. The look-and-feel of the poll form and results page can be customized using a standard CSS file. Data is stored in flat files, therefore no database is required.

Features

  • Quick and easy to install.
  • The poll data is stored in flat files, so no database is required.
  • Prevents the same IP address from voting on a poll more than once.
  • XHTML syntax compliant, and compatible with both IE and Firefox.
  • Colors and fonts are defined in an ordinary, customizable CSS file.
  • The script is highly configurable and customizable.
  • Multiple polls on the your site can utilize the same instance of the script.
  • Poll options can be rendered as either radio buttons or a combobox.
  • Includes an example page demonstrating how to add a poll to virtually any PHP page on your website.

Download Poll Script In PHP