Php poll script

PHP Poll Script

PHP Poll Script


    Are you looking for the simple and fancy PHP poll script ? I have been thinking to make php poll script from long time, It was in top 10 list of my todo. So here i am presenting simple and light weight php ajax based poll script, you can integrate it in to your page with minimum setup. I have tried to minimize index page as much as possible so it will be easy for users to integrate it in their page easily.
    Database design is also fluid where you can have 2 options as answer or may be 4 or may be 10, whatever you want. You just have add all that answers under the same question id. Please note that this script is far different that survey system, survey system includes all the features like textbox, dropdown, textarea and other html controls. php poll script only allows option button, If you want to replace option buttons with checkbox then you have to make few changes to the script.js javascript file. I havent implemented that feature i left that for you :)
   I have tried to decorate the element using CSS3 features, I have copied that CSS3 rules from other tutorials as my motto was to design the poll system and not to teach you css3 so i am not going to explain that here.
   Right now there is no blockage like user can answer only once or so, This is demo version so you can vote as many as times, but if you want to implement that feature you can easily implement it with just one change in select query. Script already stores the user IP address so you dont have to make any other changes to the database.

Lets have a look at the code snippets

<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
 <head>
  <title> PHP POll </title>
  <link href="style.css" rel="stylesheet" type="text/css"/> 
  <script src="jquery-1.8.3.min.js"></script>
  <script src="script.js"></script>
 </head>
 <body>
   <div class="container">
	   <div class="poll">Loading...</div><br>
	   <div class="sub">
		   <a href="#" class="button">Submit</a>
		   <div class="next"><a href="javascript:;" onClick="javascript:get_poll();">Next Question</a></div>
	   </div>	
   </div>
 </body>
</html>

Download PHP Poll Script

php poll (113)

About Amit

   Myself Amit Patil from Maharashtra (India). I have been working as a Web Application Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically i am a PHP developer but now a days exploring more in CSS and javascript.

Speak Your Mind

*


*

Notify me of followup comments via e-mail. You can also subscribe without commenting.

More in Ajax, CSS, HTML, jQuery, PHP (2 of 42 articles)


In a previous post i demonstrated how to make Ajax file upload HTML5 drag and drop file upload progress bar ...